[m-rev.] for review: record use of reserved addresses

Peter Wang novalazy at gmail.com
Mon Oct 1 13:28:57 AEST 2007


On 2007-09-25, Zoltan Somogyi <zs at csse.unimelb.edu.au> wrote:
> compiler/type_util.m:
> 	Factor out some common code, and replace some map.searches (that could
> 	fail only if previous code screwed up) with map.lookup.

This change causes the following problem to appear when building
builtin.m in non-C grades.

make_hlds_passes.m:183 succeeds on compiler_generated_rtti_for_builtins,
so we call add_builtin_type_ctor_special_preds for the type_ctors in
builtin_type_ctors_with_no_hlds_type_defn, e.g. builtin.int/0.

classify_type_ctor gets called, which knows about unqualified("int")/0,
but not builtin.int/0.  It tries to look that up in the type definition
table, but aborts because it doesn't exist.

How should I fix this?

Peter


Uncaught Mercury exception:
Software Error: map.lookup: key not found
        Key Type: parse_tree.prog_data.type_ctor
        Key Value: type_ctor(qualified(unqualified("builtin"), "int"), 0)
        Value Type: hlds.hlds_data.hlds_type_defn
Stack dump follows:
   0       pred exception.throw/1-0 (erroneous) (exception.m:388)
   1       pred require.error/1-0 (erroneous) (require.m:122)
   2       pred require.report_lookup_error/3-0 (erroneous) (require.m:98)
   3       pred map.lookup/3-0 (det) (map.m:612)
   4       func check_hlds.type_util.classify_type_ctor/2-0 (det) (type_util.m:647)
   5       pred hlds.special_pred.special_pred_is_generated_lazily/4-0 (semidet) (special_pred.m:214)
   6       pred hlds.make_hlds.add_special_pred.add_special_preds/8-0 (det) (add_special_pred.m:122)
   7       pred hlds.make_hlds.make_hlds_passes.add_builtin_type_ctor_special_preds/3-0 (det) (make_hlds_passes.m:224)
   8       pred list.foldl/4-1 (det) (list.m:2051)
   9       pred hlds.make_hlds.make_hlds_passes.do_parse_tree_to_hlds/10-0 (det) (make_hlds_passes.m:185)
  10       pred hlds.make_hlds.parse_tree_to_hlds/10-0 (det) (make_hlds.m:145)
  11       pred top_level.mercury_compile.make_hlds/15-0 (det) (mercury_compile.m:2024)
  12       pred top_level.mercury_compile.pre_hlds_pass/12-0 (det) (mercury_compile.m:1860)
  13       pred top_level.mercury_compile.mercury_compile/8-0 (det) (mercury_compile.m:1502)
  14       pred top_level.mercury_compile.compile/10-0 (det) (mercury_compile.m:1483)
  15       pred list.map_foldl/5-0 (det) (list.m:2179)
  16       pred top_level.mercury_compile.compile_all_submodules/11-0 (det) (mercury_compile.m:1285)
  17       pred top_level.mercury_compile.process_module_2/7-0 (det) (mercury_compile.m:1259)
  18       pred top_level.mercury_compile.process_module/7-0 (det) (mercury_compile.m:1175)
  19       pred top_level.mercury_compile.process_arg_2/7-0 (det) (mercury_compile.m:922)
  20       pred top_level.mercury_compile.process_arg_build/9-0 (det) (mercury_compile.m:884)
  21       pred make.util.build_with_module_options_args_invoked/11-0 (det) (make.util.m:805)
  22       pred make.util.build_with_module_options_args/10-0 (det) (make.util.m:759)
  23       pred top_level.mercury_compile.process_arg/7-0 (det) (mercury_compile.m:859)
  24       pred top_level.mercury_compile.process_arg_list_2/7-0 (det) (mercury_compile.m:833)
  25       pred top_level.mercury_compile.process_arg_list/7-0 (det) (mercury_compile.m:820)
  26       pred top_level.mercury_compile.process_args/7-0 (det) (mercury_compile.m:778)
  27       pred top_level.mercury_compile.process_all_args/7-0 (det) (mercury_compile.m:583)
  28       pred top_level.mercury_compile.main_2/7-0 (det) (mercury_compile.m:461)
  29       pred top_level.mercury_compile.real_main/2-0 (det) (mercury_compile.m:293)
  30       pred top_level.main/2-0 (det) (top_level.m:50)

--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list