Closed
Bug 411843
Opened 18 years ago
Closed 18 years ago
ESC line numbers incorrect
Categories
(Tamarin Graveyard :: Self-hosting compiler (ESC), defect)
Tamarin Graveyard
Self-hosting compiler (ESC)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: markh, Assigned: lhansen)
Details
Attachments
(3 files)
|
474 bytes,
patch
|
lhansen
:
review+
|
Details | Diff | Splinter Review |
|
8.96 KB,
patch
|
markh
:
review+
|
Details | Diff | Splinter Review |
|
3.86 KB,
patch
|
jodyer
:
review+
|
Details | Diff | Splinter Review |
ESC sometimes generates OP_debugline instructions in the wrong place.
To reproduce, create a sourcefile containing 'x=y\n'. Compile it using esc.sh and encode it using abcencode.sh. The 'code' in the resulting .asm file shows:
, 'code': [ [ 'getlocal0' ]
, [ 'pushscope' ]
, [ 'debugfile', 5 ]
, [ 'debugline', 1 ]
, [ 'findproperty', 4 ]
, [ 'debugline', 2 ]
, [ 'findpropstrict', 5 ]
, [ 'getproperty', 5 ]
Note the second 'debugline' instruction - it is indicating we are on line 2 way too early - that first 'findproperty' is locating the 'x' - assignment doesn't finish until 6 or 7 instructions later.
Comment 1•18 years ago
|
||
ESC was using the line number for the wrong token. And then it was mistakenly adding 1 to it. The first problem ended up with the correct line number sometimes, since often the next token was on the same line. The second problem made everything off by one.
Attachment #298746 -
Flags: review?(lhansen)
| Assignee | ||
Updated•18 years ago
|
Attachment #298746 -
Flags: review?(lhansen) → review+
Comment 2•18 years ago
|
||
Pushed fix to tc.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
| Reporter | ||
Comment 4•18 years ago
|
||
There appears to have been a regression here - the same sample above appears to generate identical asm as shown above - ie, a premature debugline instruction.
Status: VERIFIED → REOPENED
Resolution: FIXED → ---
| Assignee | ||
Updated•18 years ago
|
Assignee: nobody → lhansen
Status: REOPENED → NEW
| Assignee | ||
Comment 5•18 years ago
|
||
The problem was that the token was consumed before its source position was recorded. This happened all over the place and I've gone over the parser and fixed the obvious ones.
Attachment #302524 -
Flags: review?(mhammond)
| Reporter | ||
Comment 6•18 years ago
|
||
Comment on attachment 302524 [details] [diff] [review]
Patches for the regression (and for similar, unfixed bugs)
looks good and works for me.
Attachment #302524 -
Flags: review?(mhammond) → review+
| Assignee | ||
Comment 7•18 years ago
|
||
378:e5dc4ee7b1ff
Status: NEW → RESOLVED
Closed: 18 years ago → 18 years ago
Resolution: --- → FIXED
| Reporter | ||
Comment 8•18 years ago
|
||
This seems to have come back (at rev 548). In the example above, the runtime error seen is:
ReferenceError: Error #1065: Variable y is not defined.
at global$init()[hello.as:0]
You can add as many lines at the start as you like, and the line will continue to be reported as 0. If you put a successful line first, the error will then be reported as being at the line which worked. Sadly, the abc encoder is currently broken so I can't paste in the assembler.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
| Reporter | ||
Comment 9•18 years ago
|
||
I may have misled - rev 548 is what I happen to be at and is only a couple of days old. There is nothing to suggest that rev was responsible for the problem though.
| Assignee | ||
Updated•18 years ago
|
Status: REOPENED → ASSIGNED
| Assignee | ||
Comment 10•18 years ago
|
||
Attachment #323690 -
Flags: review?(jodyer)
Attachment #323690 -
Flags: review?(jodyer) → review+
| Assignee | ||
Comment 11•18 years ago
|
||
Pushed.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago → 18 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•