Revert #2137, the extra (seemingly leftover) DW_OP_deref is in fact essential (#2156)

* Revert "don't leave Deref bytecode for Code chunk (#2137)"

This reverts commit 30b9e69136.

* add explanation that DW_OP_deref is needed
This commit is contained in:
Gabor Greif
2020-08-21 20:12:30 +02:00
committed by GitHub
parent 70b3fd3c10
commit ec87aee147

View File

@@ -458,7 +458,8 @@ where
Operation::Deref { .. } => {
flush_code_chunk!();
parts.push(CompiledExpressionPart::Deref);
continue;
// Don't re-enter the loop here (i.e. continue), because the
// DW_OP_deref still needs to be kept.
}
_ => {
return Ok(None);
@@ -724,7 +725,7 @@ mod tests {
},
CompiledExpressionPart::Code(vec![35, 5]),
CompiledExpressionPart::Deref,
CompiledExpressionPart::Code(vec![159])
CompiledExpressionPart::Code(vec![6, 159])
],
need_deref: false
}