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

Unified Diff: src/compiler/typer.cc

Issue 1266743002: [turbofan] Fix invalid access to Parameter index. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/typer.cc
diff --git a/src/compiler/typer.cc b/src/compiler/typer.cc
index 3f4bd27ec6a3ce875d40ee962924a02fe0fc512b..85b73c825f549da003767458007df90f19f5ec54 100644
--- a/src/compiler/typer.cc
+++ b/src/compiler/typer.cc
@@ -7,6 +7,7 @@
#include "src/base/flags.h"
#include "src/base/lazy-instance.h"
#include "src/bootstrapper.h"
+#include "src/compiler/common-operator.h"
#include "src/compiler/graph-reducer.h"
#include "src/compiler/js-operator.h"
#include "src/compiler/node.h"
@@ -571,11 +572,11 @@ Bounds Typer::Visitor::TypeIfException(Node* node) {
Bounds Typer::Visitor::TypeParameter(Node* node) {
- int param = OpParameter<int>(node);
- Type::FunctionType* function_type = typer_->function_type();
- if (function_type != nullptr && param >= 0 &&
- param < static_cast<int>(function_type->Arity())) {
- return Bounds(Type::None(), function_type->Parameter(param));
+ if (Type::FunctionType* function_type = typer_->function_type()) {
+ int const index = ParameterIndexOf(node->op());
+ if (index >= 0 && index < function_type->Arity()) {
+ return Bounds(Type::None(), function_type->Parameter(index));
+ }
}
return Bounds::Unbounded(zone());
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698