Closed Bug 630649 Opened 13 years ago Closed 13 years ago

jump bypasses variable initialization

Categories

(Core :: JavaScript Engine, defect)

x86
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: espindola, Assigned: espindola)

References

Details

Attachments

(1 file)

Clang rejects code like

void* r;
void pushNewFrame(void *);
int match() {
  {
    bool minSatisfied = true;
    pushNewFrame( &&RRETURN_1);
  RRETURN_1: ;
  }
  goto *r;
}

with the error "jump bypasses variable initialization". IMHO the error is reasonable, so the attached patch changes the pcre code. If you think otherwise, let me know why and I will try to change clang instead.
Attachment #508867 - Attachment is patch: true
Attachment #508867 - Flags: review?(dmandelin)
Attachment #508867 - Flags: review?(dmandelin) → review+
That needs to go upstream too, right?
Maybe. I noticed that the minSatisfied was recently introduced. I am not sure if it is a mozilla local change or not. If it is not, then yes, this should go upstream too.
It is a mozilla-only change. cdleary and I added it to correctly implement ECMA-262 repeated-empty-match semantics.
What's the testcase that the change fixed? (it would be useful to have YARR be conformant with the spec upstream -- at least where it's possible)
(In reply to comment #4)
> What's the testcase that the change fixed? (it would be useful to have YARR be
> conformant with the spec upstream -- at least where it's possible)

The change was in PCRE--I thought you weren't using it anymore (yarr-interpreter instead). Bug 627609 is the most recent one fixed by these changes: it and its dups have some test cases.
Oh, I assumed it was a reference to YARR interpreter (with some significant code style changes :D )

Not sure why i'm  CC'd on this bug :)

(In reply to comment #5)
> (In reply to comment #4)
> > What's the testcase that the change fixed? (it would be useful to have YARR be
> > conformant with the spec upstream -- at least where it's possible)
> 
> The change was in PCRE--I thought you weren't using it anymore
> (yarr-interpreter instead). Bug 627609 is the most recent one fixed by these
> changes: it and its dups have some test cases.
Attachment #508867 - Flags: approval2.0? → approval2.0+
Keywords: checkin-needed
Assignee: general → respindola
This patch doesn't apply anymore, because of the similar changes from Bug 632964.
OS: Mac OS X → Windows 7
The good news is that that change fixed this bug too :-)
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
so looks like checkin-needed is not needed anymore here, correct if I'm wrong please.
Keywords: checkin-needed
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: