From: Jérémie Astor Date: Mon, 30 Nov 2020 19:18:27 +0000 (+0100) Subject: :art: More CHECKs against t_null X-Git-Tag: nightly~1140^2~7 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=2e6e828d25cf24139954d5e269c6a5bbee4acbec;p=gwion.git :art: More CHECKs against t_null --- diff --git a/include/operator.h b/include/operator.h index 51a12ccb..ff2d3a6a 100644 --- a/include/operator.h +++ b/include/operator.h @@ -5,8 +5,10 @@ #define ERR_N(a, b, ...) { env_err(env, (a), (b), ## __VA_ARGS__); return env->gwion->type[et_null]; } #define DECL_ON(decl, f, exp) decl f exp; { if(!f) return env->gwion->type[et_null]; } #define DECL_BN(decl, f, exp) decl f exp; { if(f < 0) return env->gwion->type[et_null]; } -#define DECL_NN(decl, f, exp) decl f exp; { if(f == env->gwion->type[et_null) return env->gwion->type[et_null]; } +#define DECL_NN(decl, f, exp) decl f exp; { if(f == env->gwion->type[et_null]) return env->gwion->type[et_null]; } #define CHECK_ON(f) { if(!f) return env->gwion->type[et_null]; } +#define CHECK_NB(f) { if(f == env->gwion->type[et_null]) return GW_ERROR; } +#define CHECK_NO(f) { if(f == env->gwion->type[et_null]) return NULL; } #define CHECK_BN(f) { if(f < 0) return env->gwion->type[et_null]; } #define CHECK_NN(f) { if(f == env->gwion->type[et_null]) return env->gwion->type[et_null]; }