Changeset 209560 in webkit for trunk/Source/JavaScriptCore/wasm/WasmValidate.cpp
- Timestamp:
- Dec 8, 2016, 1:09:06 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/wasm/WasmValidate.cpp
r208821 r209560 112 112 113 113 114 bool WARN_UNUSED_RETURN addCall(unsigned calleeIndex, const FunctionInformation&, const Vector<ExpressionType>& args, ExpressionType& result);114 bool WARN_UNUSED_RETURN addCall(unsigned calleeIndex, const Signature*, const Vector<ExpressionType>& args, ExpressionType& result); 115 115 116 116 void dump(const Vector<ControlEntry>& controlStack, const ExpressionList& expressionStack); … … 321 321 } 322 322 323 bool Validate::addCall(unsigned, const FunctionInformation& info, const Vector<ExpressionType>& args, ExpressionType& result)324 { 325 if ( info.signature->arguments.size() != args.size()) {323 bool Validate::addCall(unsigned, const Signature* signature, const Vector<ExpressionType>& args, ExpressionType& result) 324 { 325 if (signature->arguments.size() != args.size()) { 326 326 StringBuilder builder; 327 327 builder.append("Arity mismatch in call, expected: "); 328 builder.appendNumber( info.signature->arguments.size());328 builder.appendNumber(signature->arguments.size()); 329 329 builder.append(" but got: "); 330 330 builder.appendNumber(args.size()); … … 334 334 335 335 for (unsigned i = 0; i < args.size(); ++i) { 336 if (args[i] != info.signature->arguments[i]) {337 m_errorMessage = makeString("Expected argument type: ", toString( info.signature->arguments[i]), " does not match passed argument type: ", toString(args[i]));336 if (args[i] != signature->arguments[i]) { 337 m_errorMessage = makeString("Expected argument type: ", toString(signature->arguments[i]), " does not match passed argument type: ", toString(args[i])); 338 338 return false; 339 339 } 340 340 } 341 341 342 result = info.signature->returnType;342 result = signature->returnType; 343 343 return true; 344 344 } … … 368 368 } 369 369 370 String validateFunction(const uint8_t* source, size_t length, const Signature* signature, const Vector<FunctionInformation>& functions)370 String validateFunction(const uint8_t* source, size_t length, const Signature* signature, const FunctionIndexSpace& functionIndexSpace) 371 371 { 372 372 Validate context(signature->returnType); 373 FunctionParser<Validate> validator(context, source, length, signature, function s);373 FunctionParser<Validate> validator(context, source, length, signature, functionIndexSpace); 374 374 if (!validator.parse()) { 375 375 // FIXME: add better location information here. see: https://bugs.webkit.org/show_bug.cgi?id=164288
Note:
See TracChangeset
for help on using the changeset viewer.