You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
haodong404 opened this issue
May 1, 2024
· 1 comment
Assignees
Labels
area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.P2A bug or feature request we're likely to work ontriagedIssue has been triaged by sub teamtype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)
Normally, the following code should print [2, 2, 10]. However, in practice, if I execute it using dart run, it prints the correct result [2, 2, 10]. But if I first compile it into AOT code using dart compile aot-snapshot and then run it using dartaotruntime, it prints [0, 0, 10], which is clearly an incorrect result.
List<int> encode() {
int offset =0;
List<int> part = [0, 0, 0];
for (int i =0; i <2; i++) {
part[offset] =2;
offset++;
}
// Everything will be okay if without the line below.
part[offset] =10;
// And everything will be okay if with the `print` line.// print(part);return part;
}
voidmain() {
print(encode());
}
Dart Infomation
- Dart 3.3.2 (stable) (Tue Mar 19 20:44:48 2024 +0000) on "macos_arm64"
- on macos / Version 14.4.1 (Build 23E224)
Actually, I have tried the latest dev version (3.5.0-109.0.dev), and this issue still exists.
The text was updated successfully, but these errors were encountered:
mraleph
added
area-vm
Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
labels
May 1, 2024
I think it is a bug in DSE: it probably thinks that both of these stores are storing to the same place, but they are not - because offset is a phi. Can you look at this @alexmarkov?
area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.P2A bug or feature request we're likely to work ontriagedIssue has been triaged by sub teamtype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)
Problem Code
Normally, the following code should print
[2, 2, 10]
. However, in practice, if I execute it usingdart run
, it prints the correct result[2, 2, 10]
. But if I first compile it into AOT code usingdart compile aot-snapshot
and then run it usingdartaotruntime
, it prints [0, 0, 10], which is clearly an incorrect result.Dart Infomation
Actually, I have tried the latest dev version (3.5.0-109.0.dev), and this issue still exists.
The text was updated successfully, but these errors were encountered: