mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 08:44:27 +00:00
[vm/compiler] fix missing unbox code
Rationale: Two safe non-speculative cases were missing, causing AOT to crash on some fuzzing sessions. Note fuzzer is regression test here. https://github.com/dart-lang/sdk/issues/38145 Change-Id: I12c633d66e387c703f1bcf0b6eebd50165bb2970 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115445 Reviewed-by: Alexander Markov <alexmarkov@google.com> Commit-Queue: Aart Bik <ajcbik@google.com>
This commit is contained in:
parent
c0e327ea85
commit
6be60a76e4
1 changed files with 7 additions and 4 deletions
|
@ -1611,6 +1611,7 @@ bool BlockEntryInstr::FindOsrEntryAndRelink(GraphEntryInstr* graph_entry,
|
|||
|
||||
auto goto_join = new GotoInstr(AsJoinEntry(),
|
||||
CompilerState::Current().GetNextDeoptId());
|
||||
ASSERT(parent != nullptr);
|
||||
goto_join->CopyDeoptIdFrom(*parent);
|
||||
osr_entry->LinkTo(goto_join);
|
||||
|
||||
|
@ -3101,7 +3102,7 @@ Definition* BoxInt64Instr::Canonicalize(FlowGraph* flow_graph) {
|
|||
|
||||
// Find a more precise box instruction.
|
||||
if (auto conv = value()->definition()->AsIntConverter()) {
|
||||
Definition* replacement = this;
|
||||
Definition* replacement;
|
||||
switch (conv->from()) {
|
||||
case kUnboxedInt32:
|
||||
replacement = new BoxInt32Instr(conv->value()->CopyWithType());
|
||||
|
@ -3113,9 +3114,7 @@ Definition* BoxInt64Instr::Canonicalize(FlowGraph* flow_graph) {
|
|||
UNREACHABLE();
|
||||
break;
|
||||
}
|
||||
if (replacement != this) {
|
||||
flow_graph->InsertBefore(this, replacement, NULL, FlowGraph::kValue);
|
||||
}
|
||||
flow_graph->InsertBefore(this, replacement, NULL, FlowGraph::kValue);
|
||||
return replacement;
|
||||
}
|
||||
|
||||
|
@ -5074,6 +5073,10 @@ void UnboxInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
EmitLoadFromBox(compiler);
|
||||
} else if (CanConvertSmi() && (value_cid == kSmiCid)) {
|
||||
EmitSmiConversion(compiler);
|
||||
} else if (representation() == kUnboxedInt32 && value()->Type()->IsInt()) {
|
||||
EmitLoadInt32FromBoxOrSmi(compiler);
|
||||
} else if (representation() == kUnboxedInt64 && value()->Type()->IsInt()) {
|
||||
EmitLoadInt64FromBoxOrSmi(compiler);
|
||||
} else {
|
||||
ASSERT(CanDeoptimize());
|
||||
EmitLoadFromBoxWithDeopt(compiler);
|
||||
|
|
Loading…
Reference in a new issue