Index: src/asmjs/asm-typer.cc |
diff --git a/src/asmjs/asm-typer.cc b/src/asmjs/asm-typer.cc |
index ddc8898266ab9fe0333503d2beb0bf3d35c99a11..36ab1408b0984ad2e0d056ccb3f8876d4d711ea2 100644 |
--- a/src/asmjs/asm-typer.cc |
+++ b/src/asmjs/asm-typer.cc |
@@ -2389,6 +2389,9 @@ AsmType* AsmTyper::ValidateCall(AsmType* return_type, Call* call) { |
DCHECK(false); |
FAIL(call, "Redeclared global identifier."); |
} |
+ if (call->GetCallType() != Call::OTHER_CALL) { |
+ FAIL(call, "Invalid call of existing global function."); |
+ } |
SetTypeOf(call_var_proxy, reinterpret_cast<AsmType*>(call_type)); |
SetTypeOf(call, return_type); |
return return_type; |
@@ -2419,6 +2422,10 @@ AsmType* AsmTyper::ValidateCall(AsmType* return_type, Call* call) { |
FAIL(call, "Function invocation does not match function type."); |
} |
+ if (call->GetCallType() != Call::OTHER_CALL) { |
+ FAIL(call, "Invalid forward call of global function."); |
+ } |
+ |
SetTypeOf(call_var_proxy, call_var_info->type()); |
SetTypeOf(call, return_type); |
return return_type; |
@@ -2477,6 +2484,9 @@ AsmType* AsmTyper::ValidateCall(AsmType* return_type, Call* call) { |
DCHECK(false); |
FAIL(call, "Redeclared global identifier."); |
} |
+ if (call->GetCallType() != Call::KEYED_PROPERTY_CALL) { |
+ FAIL(call, "Invalid call of existing function table."); |
+ } |
SetTypeOf(call_property, reinterpret_cast<AsmType*>(call_type)); |
SetTypeOf(call, return_type); |
return return_type; |
@@ -2501,6 +2511,9 @@ AsmType* AsmTyper::ValidateCall(AsmType* return_type, Call* call) { |
"signature."); |
} |
+ if (call->GetCallType() != Call::KEYED_PROPERTY_CALL) { |
+ FAIL(call, "Invalid forward call of function table."); |
+ } |
SetTypeOf(call_property, previous_type->signature()); |
SetTypeOf(call, return_type); |
return return_type; |