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

Side by Side Diff: src/scanner.cc

Issue 173116: Fix an ASSERT in the scanner (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « src/scanner.h ('k') | test/cctest/test-api.cc » ('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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 // note: currently the following increment is necessary to avoid a 176 // note: currently the following increment is necessary to avoid a
177 // test-parser problem! 177 // test-parser problem!
178 pos_++; 178 pos_++;
179 return static_cast<uc32>(-1); 179 return static_cast<uc32>(-1);
180 } 180 }
181 } 181 }
182 182
183 183
184 void TwoByteStringUTF16Buffer::PushBack(uc32 ch) { 184 void TwoByteStringUTF16Buffer::PushBack(uc32 ch) {
185 pos_--; 185 pos_--;
186 ASSERT(pos_ >= 0 && raw_data_[pos_] == ch); 186 ASSERT(pos_ >= Scanner::kCharacterLookaheadBufferSize);
187 ASSERT(raw_data_[pos_ - Scanner::kCharacterLookaheadBufferSize] == ch);
187 } 188 }
188 189
189 190
190 void TwoByteStringUTF16Buffer::SeekForward(int pos) { 191 void TwoByteStringUTF16Buffer::SeekForward(int pos) {
191 pos_ = pos; 192 pos_ = pos;
192 } 193 }
193 194
194 195
195 // ---------------------------------------------------------------------------- 196 // ----------------------------------------------------------------------------
196 // Scanner 197 // Scanner
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after
965 } 966 }
966 AddCharAdvance(); 967 AddCharAdvance();
967 } 968 }
968 TerminateLiteral(); 969 TerminateLiteral();
969 970
970 next_.location.end_pos = source_pos() - 1; 971 next_.location.end_pos = source_pos() - 1;
971 return true; 972 return true;
972 } 973 }
973 974
974 } } // namespace v8::internal 975 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/scanner.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698