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

Unified Diff: runtime/vm/exceptions.cc

Issue 12079071: Fix a crash bug when creating a stack trace from an optimized frame. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: refactored iterator 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/stack_frame.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/exceptions.cc
===================================================================
--- runtime/vm/exceptions.cc (revision 17840)
+++ runtime/vm/exceptions.cc (working copy)
@@ -55,18 +55,15 @@
if (code.is_optimized()) {
// For optimized frames, extract all the inlined functions if any
// into the stack trace.
- InlinedFunctionsInDartFrameIterator optimized_frames(frame);
- while (true) {
- uword pc = 0;
- func = optimized_frames.GetNextFunction(&pc);
- if (func.IsNull()) {
- break;
- }
+ for (InlinedFunctionsIterator it(frame); !it.Done(); it.Advance()) {
+ func = it.function();
+ code = it.code();
+ uword pc = it.pc();
ASSERT(pc != 0);
+ ASSERT(code.EntryPoint() <= pc);
+ ASSERT(pc < (code.EntryPoint() + code.Size()));
if (ShouldShowFunction(func)) {
- code = func.unoptimized_code();
offset = Smi::New(pc - code.EntryPoint());
- ASSERT(0 <= offset.Value() && offset.Value() < code.Size());
func_list.Add(func);
code_list.Add(code);
pc_offset_list.Add(offset);
« no previous file with comments | « no previous file | runtime/vm/stack_frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698