Line numbers not reported at start of blocks

Project:GNU Smalltalk
Component:VM
Category:bug
Priority:normal
Assigned:Unassigned
Status:active
Description

At the start of a block, a line number bytecode is not generated. This is compounded when blocks contain only statements that are messages to blocks or when blocks are stored for later evaluation.

The following code will highlight this:
[

 [
   Processor activeProcess context backtrace
 ] value.
 [
   Processor activeProcess context backtrace
 ] value

] value

Evaluation will produce:
optimized [] in UndefinedObject>>executeStatements (LineNumberTest.st:3)
optimized [] in UndefinedObject>>executeStatements (LineNumberTest.st:1)
UndefinedObject>>executeStatements (LineNumberTest.st:1)
optimized [] in UndefinedObject>>executeStatements (LineNumberTest.st:6)
optimized [] in UndefinedObject>>executeStatements (LineNumberTest.st:1)
UndefinedObject>>executeStatements (LineNumberTest.st:1)

The second and fifth output lines are showing the start of the outer block, but should be showing the start of the inner blocks.

The code to request a line number bytecode is in libgst/comp.c (line 1227) using flag LN_FORCE, but in libgst/byte.c this does not generate a line number bytecode. The enclosed patch will allow a line number bytecode to be produced in this situation (this is the only place where LN_FORCE is used). With this, the output from the above code becomes:
optimized [] in UndefinedObject>>executeStatements (LineNumberTest.st:3)
optimized [] in UndefinedObject>>executeStatements (LineNumberTest.st:2)
UndefinedObject>>executeStatements (LineNumberTest.st:1)
optimized [] in UndefinedObject>>executeStatements (LineNumberTest.st:6)
optimized [] in UndefinedObject>>executeStatements (LineNumberTest.st:5)
UndefinedObject>>executeStatements (LineNumberTest.st:1)

Here, the correct lines for the inner blocks are displayed.

User login