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

Side by Side Diff: src/objects.cc

Issue 7149019: Guard an unsafe cast of a catch context's extension object. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 6 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/contexts.cc ('k') | src/runtime.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 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 3210 matching lines...) Expand 10 before | Expand all | Expand 10 after
3221 if (ctxobj->map()->constructor() == arguments_function) { 3221 if (ctxobj->map()->constructor() == arguments_function) {
3222 if (ctxobj->ReferencesObject(obj)) { 3222 if (ctxobj->ReferencesObject(obj)) {
3223 return true; 3223 return true;
3224 } 3224 }
3225 } else if (ctxobj == obj) { 3225 } else if (ctxobj == obj) {
3226 return true; 3226 return true;
3227 } 3227 }
3228 } 3228 }
3229 } 3229 }
3230 3230
3231 // Check the context extension if any. 3231 // Check the context extension (if any) if it can have references.
3232 if (context->has_extension()) { 3232 if (context->has_extension() && !context->IsCatchContext()) {
3233 return JSObject::cast(context->extension())->ReferencesObject(obj); 3233 return JSObject::cast(context->extension())->ReferencesObject(obj);
3234 } 3234 }
3235 } 3235 }
3236 3236
3237 // No references to object. 3237 // No references to object.
3238 return false; 3238 return false;
3239 } 3239 }
3240 3240
3241 3241
3242 MaybeObject* JSObject::PreventExtensions() { 3242 MaybeObject* JSObject::PreventExtensions() {
(...skipping 7963 matching lines...) Expand 10 before | Expand all | Expand 10 after
11206 if (break_point_objects()->IsUndefined()) return 0; 11206 if (break_point_objects()->IsUndefined()) return 0;
11207 // Single beak point. 11207 // Single beak point.
11208 if (!break_point_objects()->IsFixedArray()) return 1; 11208 if (!break_point_objects()->IsFixedArray()) return 1;
11209 // Multiple break points. 11209 // Multiple break points.
11210 return FixedArray::cast(break_point_objects())->length(); 11210 return FixedArray::cast(break_point_objects())->length();
11211 } 11211 }
11212 #endif 11212 #endif
11213 11213
11214 11214
11215 } } // namespace v8::internal 11215 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/contexts.cc ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698