Commit fd429bdb authored by marja's avatar marja Committed by Commit bot

VariableProxy: when cloning, don't even think about creating dangling references.

The code path for cloning resolved VariableProxys (into a different
Zone) was never hit, but if it was, it would create a dangling
reference, since the Variable would stay in the original Zone.

Kudos to verwaest@ for finding this!

R=verwaest@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2368253002
Cr-Commit-Position: refs/heads/master@{#39723}
parent 7bffaaac
......@@ -186,11 +186,8 @@ VariableProxy::VariableProxy(const VariableProxy* copy_from)
end_position_(copy_from->end_position_),
next_unresolved_(nullptr) {
bit_field_ = copy_from->bit_field_;
if (copy_from->is_resolved()) {
var_ = copy_from->var_;
} else {
raw_name_ = copy_from->raw_name_;
}
DCHECK(!copy_from->is_resolved());
raw_name_ = copy_from->raw_name_;
}
void VariableProxy::BindTo(Variable* var) {
......
Markdown is supported
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