[gjs] stack: Fix gjs_dumpstack



commit 5c90e776ce3c096bccba5ad111bf6c80b9cfb060
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu Sep 13 19:48:27 2012 -0300

    stack: Fix gjs_dumpstack
    
    We need to iterate the stack here at least once or the while
    loop will terminate early.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=683992

 gjs/stack.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gjs/stack.c b/gjs/stack.c
index 84e1c6a..8013e30 100644
--- a/gjs/stack.c
+++ b/gjs/stack.c
@@ -207,9 +207,12 @@ void
 gjs_context_print_stack_to_buffer(GjsContext* context, void *initial, GString *buf)
 {
     JSContext *js_context = (JSContext*)gjs_context_get_native_context(context);
-    JSStackFrame* fp = initial;
+    JSStackFrame *fp = initial;
     int num = 0;
 
+    if (fp == NULL)
+        JS_FrameIterator(js_context, &fp);
+
     while (fp) {
         format_frame(js_context, fp, buf, num);
         num++;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]