record perm vars only while resident stack frame is still up
@@ -592,9 +592,10 @@ fn record_var_places(&self, chunk_num: usize, alloc_locs: &AllocVarDict,
{
for (var, var_data) in alloc_locs {
match var_data {
- &VarData::Perm(p) if p > 0 => {
+ &VarData::Perm(p) if p > 0 =>
+ if !heap_locs.contains_key(var) {
let e = self.e;
- let r = var_data.as_reg_type().reg_num();
+ let r = var_data.as_reg_type().reg_num(); // crashes here.
let addr = self.and_stack[e][r].clone();
heap_locs.insert(var.clone(), addr);
