mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 10:49:00 +00:00
[vm/compiler] Avoid undefined evaluation order in IL deserialization
IL deserialization should not read 2 components of pair Location via 2 sub-expressions as they can be swapped due to a different evaluation order. TEST=language/records/simple/constants_and_field_access_test/1 (on Windows) Fixes https://github.com/dart-lang/sdk/issues/51548 Change-Id: I7f97dbb5ed10b700d4cdcea6fa5ebb873ca789c7 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285860 Commit-Queue: Alexander Markov <alexmarkov@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
parent
36ee2f3adb
commit
e7af7ea88f
1 changed files with 3 additions and 1 deletions
|
@ -1252,7 +1252,9 @@ void Location::Write(FlowGraphSerializer* s) const {
|
|||
Location Location::Read(FlowGraphDeserializer* d) {
|
||||
const uword value = d->Read<uword>();
|
||||
if (value == kPairLocationTag) {
|
||||
return Location::Pair(Location::Read(d), Location::Read(d));
|
||||
const Location first = Location::Read(d);
|
||||
const Location second = Location::Read(d);
|
||||
return Location::Pair(first, second);
|
||||
} else if ((value & kConstantTag) == kConstantTag) {
|
||||
ConstantInstr* instr = d->ReadRef<Definition*>()->AsConstant();
|
||||
ASSERT(instr != nullptr);
|
||||
|
|
Loading…
Reference in a new issue