2024-07-13 13:34 AEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000091mercuryBugpublic2016-07-01 10:11
Assigned Tojuliensf 
Product Version 
Target VersionFixed in Version 
Summary0000091: compiler throws exception in hlc.gc
Description$ tar -xzf bug.tar.gz
$ mmc --version
Mercury Compiler, version rotd-2009-03-08, configured for x86_64-unknown-linux-gnu
Copyright (C) 1993-2009 The University of Melbourne
$ mmc --grade hlc.gc run.m
Uncaught Mercury exception:
Software Error: map.lookup: key not found
    Key Type: parse_tree.prog_data.type_ctor
    Key Value: type_ctor(qualified(unqualified("interpreter"), "value"), 0)
    Value Type: hlds.hlds_data.hlds_type_defn
Stack dump not available in this grade.

Error still occurs with -O-1.
TagsNo tags attached.
Attached Files

duplicate of 0000017resolvedzs no error for unknown types in interface if defined in implementation 



maclarty (developer)

The problem here seems to be that the type interpreter.value/0 is not exported to interpreter.int. It is not exported, because it is only defined in the implementation. It is however used in the interface as the argument of another type's functor. One would expect this to cause an error when compiling interpreter.m.

I've attached a simpler test case that triggers this bug. In bug2.m type a uses type b in the interface, but type b is only defined in the implementation. This module compiles without error (mmc -C bug2.m).


maclarty (developer)

Of course this doesn't explain why the original program compiles in asm_fast.gc.


juliensf (administrator)

The fix for 0000017 also resolves this one. The larger of the two test cases still causes an abort in the compiler
but that's only because the supplied .int files are invalid -- newer versions of the compiler won't allow them to be generated in the first place.

-Issue History
Date Modified Username Field Change
2009-03-09 22:32 maclarty New Issue
2009-03-09 22:32 maclarty File Added: bug.tar.gz
2009-03-11 17:59 maclarty Note Added: 0000161
2009-03-11 18:01 maclarty File Added: bug2.m
2009-03-11 18:02 maclarty Note Added: 0000162
2015-10-31 20:42 juliensf Relationship added duplicate of 0000017
2016-07-01 10:11 juliensf Note Added: 0000891
2016-07-01 10:11 juliensf Status new => resolved
2016-07-01 10:11 juliensf Resolution open => fixed
2016-07-01 10:11 juliensf Assigned To => juliensf
+Issue History