Closed Bug 506253 Opened 15 years ago Closed 11 years ago

GetNativeRegExp's use of u.code/u.func confuses coverity

Categories

(Core :: JavaScript Engine, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: timeless, Unassigned)

References

(Blocks 1 open bug, )

Details

(Keywords: coverity)

I'm just noting this, Coverity 4.2 can't see that code and func are related here:

3200     union { NIns *code; NativeRegExp func; } u;
3201     u.code = fragment->code();
3202     return u.func;

I know unions are fun, but I'm wondering if a cast might be more appropriate.
No, a cast is wrong and violates strict aliasing analysis. Coverity needs a fix. Please file a bug with them if you can, link to it here.

/be
Does it complain about the same construct in js_ExecuteTree?  Probably so, but if it doesn't there may be a safe workaround available...
it complains about it a lot, i used this single url to FALSE all of the subsequent items, and yes, i intend to file a report (i have the contact, just not the focus, someone could bug me about reporting it...)
Code was removed.
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.