OLD | NEW |
---|---|
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/asmjs/asm-typer.h" | 5 #include "src/asmjs/asm-typer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
576 struct { | 576 struct { |
577 StandardMember standard_member; | 577 StandardMember standard_member; |
578 } kModuleParamInfo[3] = { | 578 } kModuleParamInfo[3] = { |
579 {kStdlib}, {kFFI}, {kHeap}, | 579 {kStdlib}, {kFFI}, {kHeap}, |
580 }; | 580 }; |
581 | 581 |
582 for (int ii = 0; ii < scope->num_parameters(); ++ii) { | 582 for (int ii = 0; ii < scope->num_parameters(); ++ii) { |
583 Variable* param = scope->parameter(ii); | 583 Variable* param = scope->parameter(ii); |
584 DCHECK(param); | 584 DCHECK(param); |
585 | 585 |
586 if (param->location() != VariableLocation::PARAMETER) { | |
titzer
2016/12/08 10:39:54
I don't think this is the check you want. There ar
bradn
2016/12/08 10:53:24
Done.
| |
587 FAIL(fun, "Invalid asm.js module using eval."); | |
588 } | |
589 | |
586 if (!ValidAsmIdentifier(param->name())) { | 590 if (!ValidAsmIdentifier(param->name())) { |
587 FAIL(fun, "Invalid asm.js identifier in module parameter."); | 591 FAIL(fun, "Invalid asm.js identifier in module parameter."); |
588 } | 592 } |
589 | 593 |
590 auto* param_info = VariableInfo::ForSpecialSymbol( | 594 auto* param_info = VariableInfo::ForSpecialSymbol( |
591 zone_, kModuleParamInfo[ii].standard_member); | 595 zone_, kModuleParamInfo[ii].standard_member); |
592 | 596 |
593 if (!AddGlobal(param, param_info)) { | 597 if (!AddGlobal(param, param_info)) { |
594 FAIL(fun, "Redeclared identifier in module parameter."); | 598 FAIL(fun, "Redeclared identifier in module parameter."); |
595 } | 599 } |
(...skipping 2283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2879 return true; | 2883 return true; |
2880 } | 2884 } |
2881 | 2885 |
2882 *error_message = typer.error_message(); | 2886 *error_message = typer.error_message(); |
2883 return false; | 2887 return false; |
2884 } | 2888 } |
2885 | 2889 |
2886 } // namespace wasm | 2890 } // namespace wasm |
2887 } // namespace internal | 2891 } // namespace internal |
2888 } // namespace v8 | 2892 } // namespace v8 |
OLD | NEW |