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

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

Issue 2523703002: [asmjs] Avoid truncation of error messages (Closed)
Patch Set: Created 4 years 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 | « src/asmjs/asm-typer.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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>
11 11
12 #include "src/v8.h" 12 #include "src/v8.h"
13 13
14 #include "src/asmjs/asm-types.h" 14 #include "src/asmjs/asm-types.h"
15 #include "src/ast/ast.h" 15 #include "src/ast/ast.h"
16 #include "src/ast/scopes.h" 16 #include "src/ast/scopes.h"
17 #include "src/base/bits.h" 17 #include "src/base/bits.h"
18 #include "src/codegen.h" 18 #include "src/codegen.h"
19 #include "src/globals.h" 19 #include "src/globals.h"
20 #include "src/utils.h" 20 #include "src/utils.h"
21 21
22 #define FAIL(node, msg) \ 22 #define FAIL(node, msg) \
23 do { \ 23 do { \
24 int line = node->position() == kNoSourcePosition \ 24 int line = node->position() == kNoSourcePosition \
25 ? -1 \ 25 ? -1 \
26 : script_->GetLineNumber(node->position()); \ 26 : script_->GetLineNumber(node->position()); \
27 base::OS::SNPrintF(error_message_, sizeof(error_message_), \ 27 base::OS::SNPrintF(error_message_, sizeof(error_message_), \
28 "asm: line %d: %s\n", line + 1, msg); \ 28 "asm: line %d: %s", line + 1, msg); \
29 return AsmType::None(); \ 29 return AsmType::None(); \
30 } while (false) 30 } while (false)
31 31
32 #define RECURSE(call) \ 32 #define RECURSE(call) \
33 do { \ 33 do { \
34 if (GetCurrentStackPosition() < stack_limit_) { \ 34 if (GetCurrentStackPosition() < stack_limit_) { \
35 stack_overflow_ = true; \ 35 stack_overflow_ = true; \
36 FAIL(root_, "Stack overflow while parsing asm.js module."); \ 36 FAIL(root_, "Stack overflow while parsing asm.js module."); \
37 } \ 37 } \
38 \ 38 \
(...skipping 2818 matching lines...) Expand 10 before | Expand all | Expand 10 after
2857 return true; 2857 return true;
2858 } 2858 }
2859 2859
2860 *error_message = typer.error_message(); 2860 *error_message = typer.error_message();
2861 return false; 2861 return false;
2862 } 2862 }
2863 2863
2864 } // namespace wasm 2864 } // namespace wasm
2865 } // namespace internal 2865 } // namespace internal
2866 } // namespace v8 2866 } // namespace v8
OLDNEW
« no previous file with comments | « src/asmjs/asm-typer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698