Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(388)

Unified Diff: src/compiler/js-inlining.cc

Issue 1196623002: [ubsan] Fix HeapObjectMatcher to avoid invalid casts. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/compiler/js-inlining.cc
diff --git a/src/compiler/js-inlining.cc b/src/compiler/js-inlining.cc
index 35693308fd3d320ca6c854855632c4f062b7c988..13bb0f903240a873678ea65fc7cb0dd7a6e7a1ad 100644
--- a/src/compiler/js-inlining.cc
+++ b/src/compiler/js-inlining.cc
@@ -238,11 +238,12 @@ Reduction JSInliner::Reduce(Node* node) {
if (node->opcode() != IrOpcode::kJSCallFunction) return NoChange();
JSCallFunctionAccessor call(node);
- HeapObjectMatcher<JSFunction> match(call.jsfunction());
+ HeapObjectMatcher match(call.jsfunction());
if (!match.HasValue()) return NoChange();
- Handle<JSFunction> function = match.Value().handle();
- if (!function->IsJSFunction()) return NoChange();
+ if (!match.Value().handle()->IsJSFunction()) return NoChange();
+ Handle<JSFunction> function =
+ Handle<JSFunction>::cast(match.Value().handle());
if (mode_ == kRestrictedInlining && !function->shared()->force_inline()) {
return NoChange();
}

Powered by Google App Engine
This is Rietveld 408576698