Merge lp:~zorba-coders/zorba/bug-1070706 into lp:zorba

Proposed by Ghislain Fourny
Status: Merged
Approved by: Markos Zaharioudakis
Approved revision: 11125
Merged at revision: 11123
Proposed branch: lp:~zorba-coders/zorba/bug-1070706
Merge into: lp:zorba
Diff against target: 80 lines (+29/-2)
5 files modified
src/diagnostics/xquery_stack_trace.cpp (+17/-2)
test/rbkt/ExpQueryResults/zorba/HigherOrder/hof-040.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/HigherOrder/hof-041.xml.res (+1/-0)
test/rbkt/Queries/zorba/HigherOrder/hof-040.xq (+5/-0)
test/rbkt/Queries/zorba/HigherOrder/hof-041.xq (+5/-0)
To merge this branch: bzr merge lp:~zorba-coders/zorba/bug-1070706
Reviewer Review Type Date Requested Status
Markos Zaharioudakis Approve
Sorin Marian Nasoi Approve
Review via email: mp+133484@code.launchpad.net

Commit message

Fixes a bug that leads to a crash if there are inline, anonymous functions in a stack trace.

Description of the change

Fixes a bug that leads to a crash if there are inline, anonymous functions in a stack trace.

To post a comment you must log in.
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job bug-1070706-2012-11-08T14-10-43.793Z is finished. The final status was:

All tests succeeded!

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Voting does not meet specified criteria. Required: Approve > 1, Disapprove < 1, Needs Fixing < 1, Pending < 1. Got: 3 Pending.

Revision history for this message
Sorin Marian Nasoi (sorin.marian.nasoi) :
review: Approve
Revision history for this message
Markos Zaharioudakis (markos-za) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job bug-1070706-2012-11-08T15-22-50.872Z is finished. The final status was:

All tests succeeded!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/diagnostics/xquery_stack_trace.cpp'
2--- src/diagnostics/xquery_stack_trace.cpp 2012-09-19 21:16:15 +0000
3+++ src/diagnostics/xquery_stack_trace.cpp 2012-11-08 14:18:22 +0000
4@@ -15,12 +15,16 @@
5 */
6 #include "stdafx.h"
7
8+#include "xquery_stack_trace.h"
9+
10 #include <typeinfo>
11
12+#include <store/api/item_factory.h>
13+#include <store/api/store.h>
14+#include <system/globalenv.h>
15 #include <zorba/xquery_exception.h>
16
17 #include "diagnostic.h"
18-#include "xquery_stack_trace.h"
19
20 namespace zorba {
21
22@@ -56,6 +60,17 @@
23 XQueryStackTrace::fn_arity_type fn_arity,
24 ZorbaException &ze )
25 {
26+ store::Item_t lPrintedFunctionName;
27+ if (fn_name == NULL)
28+ {
29+ GENV_STORE.getItemFactory()->createQName(
30+ lPrintedFunctionName,
31+ "",
32+ "inline",
33+ "anonymous");
34+ } else {
35+ lPrintedFunctionName = fn_name;
36+ }
37 if ( XQueryException *const xe = dynamic_cast<XQueryException*>( &ze ) )
38 {
39 XQueryStackTrace &trace = xe->query_trace();
40@@ -77,7 +92,7 @@
41
42 trace.push(
43 XQueryStackTrace::Entry(
44- diagnostic::to_QName<XQueryStackTrace::fn_name_type>( fn_name ),
45+ diagnostic::to_QName<XQueryStackTrace::fn_name_type>( lPrintedFunctionName ),
46 fn_arity,
47 call_loc.getFilename().c_str(),
48 call_loc.getLineBegin(),
49
50=== added file 'test/rbkt/ExpQueryResults/zorba/HigherOrder/hof-040.xml.res'
51--- test/rbkt/ExpQueryResults/zorba/HigherOrder/hof-040.xml.res 1970-01-01 00:00:00 +0000
52+++ test/rbkt/ExpQueryResults/zorba/HigherOrder/hof-040.xml.res 2012-11-08 14:18:22 +0000
53@@ -0,0 +1,1 @@
54+0
55
56=== added file 'test/rbkt/ExpQueryResults/zorba/HigherOrder/hof-041.xml.res'
57--- test/rbkt/ExpQueryResults/zorba/HigherOrder/hof-041.xml.res 1970-01-01 00:00:00 +0000
58+++ test/rbkt/ExpQueryResults/zorba/HigherOrder/hof-041.xml.res 2012-11-08 14:18:22 +0000
59@@ -0,0 +1,1 @@
60+0
61
62=== added file 'test/rbkt/Queries/zorba/HigherOrder/hof-040.xq'
63--- test/rbkt/Queries/zorba/HigherOrder/hof-040.xq 1970-01-01 00:00:00 +0000
64+++ test/rbkt/Queries/zorba/HigherOrder/hof-040.xq 2012-11-08 14:18:22 +0000
65@@ -0,0 +1,5 @@
66+declare namespace o = "http://www.zorba-xquery.com/options/features";
67+declare namespace err = "http://www.w3.org/2005/xqt-errors";
68+declare option o:enable "hof";
69+
70+try { function () { fn:error() } () } catch err:FOER0000 { 0 }
71
72=== added file 'test/rbkt/Queries/zorba/HigherOrder/hof-041.xq'
73--- test/rbkt/Queries/zorba/HigherOrder/hof-041.xq 1970-01-01 00:00:00 +0000
74+++ test/rbkt/Queries/zorba/HigherOrder/hof-041.xq 2012-11-08 14:18:22 +0000
75@@ -0,0 +1,5 @@
76+declare namespace o = "http://www.zorba-xquery.com/options/features";
77+declare namespace err = "http://www.w3.org/2005/xqt-errors";
78+declare option o:enable "hof";
79+
80+try { function() { 1 div 0 } () } catch err:FOAR0001 { 0 }

Subscribers

People subscribed via source and target branches