@@ -272,6 +272,16 @@ struct gcc_jit_extended_asm : public gcc::jit::recording::extended_asm
272
272
} \
273
273
JIT_END_STMT
274
274
275
+ #define RETURN_IF_FAIL_PRINTF3 (TEST_EXPR, CTXT, LOC, ERR_FMT, A0, A1, A2 ) \
276
+ JIT_BEGIN_STMT \
277
+ if (!(TEST_EXPR)) \
278
+ { \
279
+ jit_error ((CTXT), (LOC), " %s: " ERR_FMT, \
280
+ __func__, (A0), (A1), (A2)); \
281
+ return ; \
282
+ } \
283
+ JIT_END_STMT
284
+
275
285
#define RETURN_IF_FAIL_PRINTF4 (TEST_EXPR, CTXT, LOC, ERR_FMT, A0, A1, A2, A3 ) \
276
286
JIT_BEGIN_STMT \
277
287
if (!(TEST_EXPR)) \
@@ -3076,6 +3086,16 @@ gcc_jit_block_add_assignment_op (gcc_jit_block *block,
3076
3086
lvalue->get_type ()->get_debug_string (),
3077
3087
rvalue->get_debug_string (),
3078
3088
rvalue->get_type ()->get_debug_string ());
3089
+ RETURN_IF_FAIL_PRINTF3 (
3090
+ lvalue->get_type ()->is_numeric () && rvalue->get_type ()->is_numeric (), ctxt, loc,
3091
+ " gcc_jit_block_add_assignment_op %s has non-numeric lvalue %s (type: %s)" ,
3092
+ gcc::jit::binary_op_reproducer_strings[op],
3093
+ lvalue->get_debug_string (), lvalue->get_type ()->get_debug_string ());
3094
+ RETURN_IF_FAIL_PRINTF3 (
3095
+ rvalue->get_type ()->is_numeric () && rvalue->get_type ()->is_numeric (), ctxt, loc,
3096
+ " gcc_jit_block_add_assignment_op %s has non-numeric rvalue %s (type: %s)" ,
3097
+ gcc::jit::binary_op_reproducer_strings[op],
3098
+ rvalue->get_debug_string (), rvalue->get_type ()->get_debug_string ());
3079
3099
3080
3100
gcc::jit::recording::statement *stmt = block->add_assignment_op (loc, lvalue, op, rvalue);
3081
3101
0 commit comments