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

Side by Side Diff: src/asmjs/typing-asm.cc

Issue 2123283007: [wasm] throw in case of assignment to module parameters (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-613928.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/typing-asm.h" 5 #include "src/asmjs/typing-asm.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "src/v8.h" 9 #include "src/v8.h"
10 10
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 // Assignment to a local or context variable. 668 // Assignment to a local or context variable.
669 VariableProxy* proxy = expr->target()->AsVariableProxy(); 669 VariableProxy* proxy = expr->target()->AsVariableProxy();
670 if (intish_ != 0) { 670 if (intish_ != 0) {
671 FAIL(expr, "intish or floatish assignment"); 671 FAIL(expr, "intish or floatish assignment");
672 } 672 }
673 if (in_function_ && target_type->IsArray()) { 673 if (in_function_ && target_type->IsArray()) {
674 FAIL(expr, "assignment to array variable"); 674 FAIL(expr, "assignment to array variable");
675 } 675 }
676 expected_type_ = target_type; 676 expected_type_ = target_type;
677 Variable* var = proxy->var(); 677 Variable* var = proxy->var();
678 if (!in_function_ && var->IsParameter()) {
679 FAIL(expr, "assignment to module parameter");
680 }
678 VariableInfo* info = GetVariableInfo(var); 681 VariableInfo* info = GetVariableInfo(var);
679 if (info == nullptr || info->type == nullptr) { 682 if (info == nullptr || info->type == nullptr) {
680 if (var->mode() == TEMPORARY) { 683 if (var->mode() == TEMPORARY) {
681 SetType(var, Type::Any()); 684 SetType(var, Type::Any());
682 info = GetVariableInfo(var); 685 info = GetVariableInfo(var);
683 } else { 686 } else {
684 FAIL(proxy, "unbound variable"); 687 FAIL(proxy, "unbound variable");
685 } 688 }
686 } 689 }
687 if (property_info_ != nullptr) { 690 if (property_info_ != nullptr) {
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after
1594 } 1597 }
1595 expected_type_ = save; 1598 expected_type_ = save;
1596 } 1599 }
1597 1600
1598 void AsmTyper::VisitRewritableExpression(RewritableExpression* expr) { 1601 void AsmTyper::VisitRewritableExpression(RewritableExpression* expr) {
1599 RECURSE(Visit(expr->expression())); 1602 RECURSE(Visit(expr->expression()));
1600 } 1603 }
1601 1604
1602 } // namespace internal 1605 } // namespace internal
1603 } // namespace v8 1606 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-613928.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698