View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000510 | LDMud 3.3 | LPC Compiler/Preprocessor | public | 2007-08-23 03:20 | 2018-01-29 21:57 |
Reporter | Gnomi | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | i686 | OS | Debian GNU/Linux | OS Version | 3.1 |
Product Version | 3.3 | ||||
Fixed in Version | 3.3.717 | ||||
Summary | 0000510: Wrong linenumber information after two inline closures in the same function | ||||
Description | When inserting pending inline closures it is assumed, that stored_line (the line where the line number information leads to) is at the current line in the file, so that some LI_BACK entries have to be inserted. Usually the store_line_number_info() call at the beginning of the loop in insert_pending_inline_closures takes care of that. But store_line_number_info updates stored_line only when some bytes were inserted into the program code. In 3/4 of the cases this happens because of the inserted bytes for alignment. For the remaining fourth wrong line number information will be generated. So at the beginning of the loop it should be also checked whether forward steps are necessary. A attached a patch that fixes this. Greetings, Gnomi. | ||||
Steps To Reproduce | Loading the following file shows the division by zero error at line 16 (at not 23). string fun() { map(({}),(: $1+0 :)) ; foreach(mapping m: filter(({}),(: $1 :))) { 1+1; } } void create() { 0/0; } | ||||
Tags | No tags attached. | ||||
Attached Files | prolang.linecounting.diff (984 bytes)
Index: trunk/src/prolang.y =================================================================== --- trunk/src/prolang.y (Revision 2314) +++ trunk/src/prolang.y (Arbeitskopie) @@ -4952,7 +4952,18 @@ store_line_number_info(); if (stored_lines > ict->start_line) store_line_number_backward(stored_lines - ict->start_line); + else + while (stored_lines < ict->start_line) + { + int lines; + lines = ict->start_line - stored_lines; + if (lines > LI_MAXEMPTY) + lines = LI_MAXEMPTY; + stored_lines += lines; + byte_to_mem_block(A_LINENUMBERS, 256 - lines); + } + FUNCTION(ict->function)->offset.pc = CURRENT_PROGRAM_SIZE + FUNCTION_PRE_HDR_SIZE; add_to_mem_block(A_PROGRAM, INLINE_PROGRAM_BLOCK(ict->start) , ict->length); | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
2007-08-23 03:20 | Gnomi | New Issue | |
2007-08-23 03:20 | Gnomi | File Added: prolang.linecounting.diff | |
2007-11-11 17:36 |
|
Status | new => resolved |
2007-11-11 17:36 |
|
Fixed in Version | => 3.3.717 |
2007-11-11 17:36 |
|
Resolution | open => fixed |
2007-11-11 17:36 |
|
Assigned To | => lars |
2007-11-11 17:36 |
|
Note Added: 0000577 | |
2009-04-14 12:14 | zesstra | Project | LDMud => LDMud 3.3 |
2010-11-16 09:42 |
|
Source_changeset_attached | => ldmud.git master 0f8e8320 |
2018-01-29 18:59 |
|
Source_changeset_attached | => ldmud.git master 0f8e8320 |
2018-01-29 21:57 |
|
Source_changeset_attached | => ldmud.git master 0f8e8320 |