> Is this really safe.  If I look at where we call
> expand_shift/expand_shift_1 I get real worried that we could end up
> using that NULL value in a context where it's not expected.
> So while emit_store_flag_force knows what to do upon NULL return, I'm
> not sure the other users of expand_shift/expand_shift_1 do.

Yes, that's probably risky, and there are a lot of calls to them.

> Is there any way to address this problem in emit_store_flag_force?

Now that we're in C++, we could add an additional argument to expand_shift_1 
with a default value and call the function directly from emit_store_flag with 
the non-default value, thus instructing it to return 0 on failure instead of 
aborting.  emit_store_flag already returns 0 on failure so the result would be 
naturally propagated up to emit_store_flag_force.

Eric Botcazou

Reply via email to