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

Side by Side Diff: src/elements.cc

Issue 9421032: Add a missing check for a failure result. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 10 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/bootstrapper.cc ('k') | src/objects.h » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 893 matching lines...) Expand 10 before | Expand all | Expand 10 after
904 return ThrowArrayLengthRangeError(array->GetHeap()); 904 return ThrowArrayLengthRangeError(array->GetHeap());
905 } 905 }
906 } 906 }
907 907
908 // Fall-back case: The new length is not a number so make the array 908 // Fall-back case: The new length is not a number so make the array
909 // size one and set only element to length. 909 // size one and set only element to length.
910 FixedArray* new_backing_store; 910 FixedArray* new_backing_store;
911 MaybeObject* maybe_obj = array->GetHeap()->AllocateFixedArray(1); 911 MaybeObject* maybe_obj = array->GetHeap()->AllocateFixedArray(1);
912 if (!maybe_obj->To(&new_backing_store)) return maybe_obj; 912 if (!maybe_obj->To(&new_backing_store)) return maybe_obj;
913 new_backing_store->set(0, length); 913 new_backing_store->set(0, length);
914 array->SetContent(new_backing_store); 914 { MaybeObject* result = array->SetContent(new_backing_store);
915 if (result->IsFailure()) return result;
916 }
915 return array; 917 return array;
916 } 918 }
917 919
918 920
919 } } // namespace v8::internal 921 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/bootstrapper.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698