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

Side by Side Diff: src/d8.cc

Issue 11777014: Fix missing exception check in typed array constructor. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 11 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 | « no previous file | test/mjsunit/regress/regress-crbug-168545.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 if (try_catch.HasCaught()) return try_catch.ReThrow(); 525 if (try_catch.HasCaught()) return try_catch.ReThrow();
526 byteLength = length * element_size; 526 byteLength = length * element_size;
527 if (byteOffset + byteLength > bufferLength) { 527 if (byteOffset + byteLength > bufferLength) {
528 return Throw("length out of bounds"); 528 return Throw("length out of bounds");
529 } 529 }
530 } 530 }
531 } else { 531 } else {
532 if (args[0]->IsObject() && 532 if (args[0]->IsObject() &&
533 args[0]->ToObject()->Has(Symbols::length(isolate))) { 533 args[0]->ToObject()->Has(Symbols::length(isolate))) {
534 // Construct from array. 534 // Construct from array.
535 length = convertToUint( 535 Local<Value> value = args[0]->ToObject()->Get(Symbols::length(isolate));
536 args[0]->ToObject()->Get(Symbols::length(isolate)), &try_catch); 536 if (try_catch.HasCaught()) return try_catch.ReThrow();
537 length = convertToUint(value, &try_catch);
537 if (try_catch.HasCaught()) return try_catch.ReThrow(); 538 if (try_catch.HasCaught()) return try_catch.ReThrow();
538 init_from_array = true; 539 init_from_array = true;
539 } else { 540 } else {
540 // Construct from size. 541 // Construct from size.
541 length = convertToUint(args[0], &try_catch); 542 length = convertToUint(args[0], &try_catch);
542 if (try_catch.HasCaught()) return try_catch.ReThrow(); 543 if (try_catch.HasCaught()) return try_catch.ReThrow();
543 } 544 }
544 byteLength = length * element_size; 545 byteLength = length * element_size;
545 byteOffset = 0; 546 byteOffset = 0;
546 547
(...skipping 1415 matching lines...) Expand 10 before | Expand all | Expand 10 after
1962 } 1963 }
1963 1964
1964 } // namespace v8 1965 } // namespace v8
1965 1966
1966 1967
1967 #ifndef GOOGLE3 1968 #ifndef GOOGLE3
1968 int main(int argc, char* argv[]) { 1969 int main(int argc, char* argv[]) {
1969 return v8::Shell::Main(argc, argv); 1970 return v8::Shell::Main(argc, argv);
1970 } 1971 }
1971 #endif 1972 #endif
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-168545.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698