Closed Bug 380889 Opened 17 years ago Closed 17 years ago

Source note disassembler assumes SRC_SWITCH always has jump table

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: igor, Assigned: igor)

References

Details

Attachments

(1 file)

Consider the following session for a debug build of js shell:

~/m/trunk/mozilla/js/src $ cat ~/m/y.js
function f(i)
{
  switch(i){
    case 1:
    case xyzzy:
  }
}

dis(f);
~/m/trunk/mozilla/js/src $ ./Linux_All_DBG.OBJ/js ~/m/y.js
main:
00000:  getarg 0
00003:  condswitch
00004:  one
00005:  case 17 (12)
00008:  name "xyzzy"
00011:  case 17 (6)
00014:  default 17 (3)
00017:  stop

Source notes:
  0:     0 [   0] newline 
Assertion failure: op == JSOP_LOOKUPSWITCH, at js.c:939
trace/breakpoint trap

The assert happens since the disassembler "forgot" that the [condswitch] bytecode also has SRC_SWITCH note.
Attached patch fix v1Splinter Review
Attachment #265006 - Flags: review?(brendan)
Attachment #265006 - Flags: review?(brendan) → review+
Blocks: js1.7src
I committed the patch from comment 1 to the trunk:

Checking in js.c;
/cvsroot/mozilla/js/src/js.c,v  <--  js.c
new revision: 3.142; previous revision: 3.141
done
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Checking in regress-380889.js;
/cvsroot/mozilla/js/tests/js1_5/extensions/regress-380889.js,v  <--  regress-380889.js
initial revision: 1.1
Flags: in-testsuite+
verified fixed 1.9.0 linux/mac*/windows.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: