You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(emit_c): use NULL directly when no expressions (static initializer constexpr)
A C static initializer can only use constant expressions. An array name
(e.g. model_expressions[]) is a constant address and legal; but a pointer
variable (const expr_def *ptr = NULL) is NOT a constant expression and
cannot appear as a field value in a static struct initializer.
Fix: when model.expressions is empty, emit nothing for the array and
use NULL literally in the ARBITER_generated_model struct initializer.
When expressions exist, emit the model_expressions[] array as before.
Also regenerated all 19 arbiter_model.{c,h} files with the fixed emitter.
Test added: test_emit_c_no_exprs_uses_null_directly verifies that empty-
expression models emit '.expressions = NULL' and no array declaration.
Co-Authored-By: Oz <oz-agent@warp.dev>
{ .id=7, .rule_class=ARBITER_RULE_SAFETY_GUARD, .condition_start=14, .condition_count=2, .action_start=1, .action_count=1, .expr_start=0, .expr_count=0, .safety_goal_id=UINT16_MAX, .set_mode=5, .safety_critical= true, .name="rule.twohand_release", .explanation="Two-hand control released — operator may be in zone." },
0 commit comments