Commit f828a63e authored by John van Groningen's avatar John van Groningen
Browse files

bug fix, create new dp_type (pointer) in unfold (if a copy hasn't already been...

bug fix, create new dp_type (pointer) in unfold (if a copy hasn't already been made) to prevent possible crash if a macro contains a dynamic pattern match
parent 8eb7f045
......@@ -623,16 +623,16 @@ instance unfold DynamicPattern
where
unfold guard=:{dp_var,dp_rhs,dp_type} us
# (dyn_info, us_symbol_heap) = readPtr dp_type us.us_symbol_heap
us & us_symbol_heap=us_symbol_heap
(new_dp_type,us_symbol_heap)
= case dyn_info of
EI_DynamicCopy new_dp_type _
# (dp_var, us) = unfold dp_var us
(dp_rhs, us) = unfold dp_rhs us
= ({guard & dp_var = dp_var, dp_rhs = dp_rhs, dp_type=new_dp_type}, us)
-> (new_dp_type,us_symbol_heap)
_
# (dp_var, us) = unfold dp_var us
-> newPtr dyn_info us_symbol_heap
us & us_symbol_heap=us_symbol_heap
(dp_var, us) = unfold dp_var us
(dp_rhs, us) = unfold dp_rhs us
= ({guard & dp_var = dp_var, dp_rhs = dp_rhs}, us)
= ({guard & dp_var = dp_var, dp_rhs = dp_rhs, dp_type=new_dp_type}, us)
instance unfold [a] | unfold a
where
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment