From 2e6e828d25cf24139954d5e269c6a5bbee4acbec Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Mon, 30 Nov 2020 20:18:27 +0100 Subject: [PATCH] :art: More CHECKs against t_null --- include/operator.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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]; } -- 2.43.0