Odd I6 6.33N compiler error: "emitter stack empty"

I was doing some mad science in Inform 7 6M62, and I got an unusual compiler error:

Inform 6.33N for Linux (30th August 2015)
File "auto.inf"; Line 11058	# *** Compiler error:  SR error: emitter stack empty

What does this error mean? It is generated when compiling to both Z-Machine and Glulx.

Attempting to compile the same code to Z with Inform 6.41 produces a different error message for the same line:

File "auto.inf"; Line 11057	# Error:  No expression between brackets '(' and ')'

This is not a fatal error, so compilation finishes. However, after compiling to Z with 6.33N, RTEs such as the following appear:

[** Programming error: object#46 (object number 46) has a property p17_specialproperty, but it is longer
than 2 bytes so you cannot use "." to read **]

This RTE does not occur if compiling to Glulx under 6.33N.

The source of the error seems to be being generated by the following declaration:

Class K16_vessel 
    class K5_container
    with parse_name Parse_Name_GV93
    with plural BC_72
    with p15_liquid_capacity 0
    with p16_current_level 0
    with p17_specialproperty specialroutine() ! suspect line
    with description BC_73
    with initial BC_74
    with list_together BC_75
    with short_name BC_76
    with article BC_77

which certainly looks like illegal code given that the routine in question can’t be executed at compile time. (This was the result of the I7 compiler doing its best to deal with the nonsense I fed it. It’s not an I7 compiler issue – I had to work hard to cause this problem.)

Am I correct in thinking that the above should be illegal I6 code?

It is illegal code.

File "auto.inf"; Line 11057	# Error:  No expression between brackets '(' and ')'

This is not a fatal error, so compilation finishes.

If the compiler emits an error, it generated an erroneous game file. Don’t run it.

As to the first question, “Compiler error” means you ran into a compiler bug. You’re asking what was up with a compiler bug that was fixed sometime between 6.33 and 6.41. This is not the sort of detail I am prone to remember. :)

Thank you for the reply, zarf. It of course makes sense to not run compiled games when there is a compilation error.

I wouldn’t normally try to do so, but in this case the IDE (Linux) was going ahead and launching the story window even though it briefly looked like failure (something I missed was happening at first). My guess is that the exit code (which was 0 despite this error) was confusing it.

As you say, it’s fixed in the I6 compiler now, and the malformed source now produces an exit code of 1, so everyone but code archaeologists can ignore this. Thanks again.

Yeah, I think that was another bug that got fixed a long time ago. The exit code should now always be nonzero on error.

1 Like