aboutsummaryrefslogtreecommitdiff
path: root/frontend/type.icl
diff options
context:
space:
mode:
authorjohnvg2012-03-19 12:44:51 +0000
committerjohnvg2012-03-19 12:44:51 +0000
commitac7feef85bb70f01d5de4917da348bda12d9739e (patch)
treee8891f7d8c25386b51b5c39573008c1e6d6269ec /frontend/type.icl
parentremove the 1024 character limit of the command buffer (diff)
clear me_type_ptr's after type checking,
if the cached type contained a generic type context, the compiler could crash git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@2047 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'frontend/type.icl')
-rw-r--r--frontend/type.icl18
1 files changed, 14 insertions, 4 deletions
diff --git a/frontend/type.icl b/frontend/type.icl
index 32c8c16..4be4892 100644
--- a/frontend/type.icl
+++ b/frontend/type.icl
@@ -2290,7 +2290,7 @@ typeProgram comps main_dcl_module_n fun_defs specials list_inferred_types icl_de
ali_tail_strict_list_first_instance_indices=tail_strict_list_first_instance_indices,
ali_instances_range={ ir_from = fun_env_size, ir_to = special_instances.si_next_array_member_index }
}
- # ts_var_heap = clear_var_heap ti_functions ts_var_heap
+ # ts_var_heap = clear_var_heap ti_functions ti_common_defs ts_var_heap
= (not type_error, fun_defs, array_and_list_instances, ti_common_defs, ti_functions,
ts_td_infos, {hp_var_heap = ts_var_heap, hp_expression_heap = ts_expr_heap, hp_type_heaps = ts_type_heaps, hp_generic_heap=ts_generic_heap },
predef_symbols, ts_error.ea_file, out)
@@ -2848,16 +2848,26 @@ where
CheckedType _
-> ts
- clear_var_heap fun_types var_heap
- = mapArraySt clear_module fun_types var_heap
+ clear_var_heap fun_types common_defs var_heap
+ # var_heap = mapArraySt clear_functions_in_module fun_types var_heap
+ = mapArraySt clear_members_in_module common_defs var_heap
where
- clear_module module_types var_heap
+ clear_functions_in_module module_types var_heap
= mapArraySt clear_function module_types var_heap
+
clear_function {ft_type_ptr} var_heap
| isNilPtr ft_type_ptr
= var_heap
= var_heap <:= (ft_type_ptr, VI_Empty)
+ clear_members_in_module common_def var_heap
+ = mapArraySt clear_member common_def.com_member_defs var_heap
+
+ clear_member {me_type_ptr} var_heap
+ | isNilPtr me_type_ptr
+ = var_heap
+ = var_heap <:= (me_type_ptr, VI_Empty)
+
mapArraySt f a s :== map_a_st 0 a s
where
map_a_st i a st