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
=== modified file 'src/diagnostics/xquery_stack_trace.cpp'
--- src/diagnostics/xquery_stack_trace.cpp 2012-09-19 21:16:15 +0000
+++ src/diagnostics/xquery_stack_trace.cpp 2012-11-08 14:18:22 +0000
@@ -15,12 +15,16 @@
15 */15 */
16#include "stdafx.h"16#include "stdafx.h"
1717
18#include "xquery_stack_trace.h"
19
18#include <typeinfo>20#include <typeinfo>
1921
22#include <store/api/item_factory.h>
23#include <store/api/store.h>
24#include <system/globalenv.h>
20#include <zorba/xquery_exception.h>25#include <zorba/xquery_exception.h>
2126
22#include "diagnostic.h"27#include "diagnostic.h"
23#include "xquery_stack_trace.h"
2428
25namespace zorba {29namespace zorba {
2630
@@ -56,6 +60,17 @@
56 XQueryStackTrace::fn_arity_type fn_arity,60 XQueryStackTrace::fn_arity_type fn_arity,
57 ZorbaException &ze ) 61 ZorbaException &ze )
58{62{
63 store::Item_t lPrintedFunctionName;
64 if (fn_name == NULL)
65 {
66 GENV_STORE.getItemFactory()->createQName(
67 lPrintedFunctionName,
68 "",
69 "inline",
70 "anonymous");
71 } else {
72 lPrintedFunctionName = fn_name;
73 }
59 if ( XQueryException *const xe = dynamic_cast<XQueryException*>( &ze ) )74 if ( XQueryException *const xe = dynamic_cast<XQueryException*>( &ze ) )
60 {75 {
61 XQueryStackTrace &trace = xe->query_trace();76 XQueryStackTrace &trace = xe->query_trace();
@@ -77,7 +92,7 @@
7792
78 trace.push(93 trace.push(
79 XQueryStackTrace::Entry(94 XQueryStackTrace::Entry(
80 diagnostic::to_QName<XQueryStackTrace::fn_name_type>( fn_name ),95 diagnostic::to_QName<XQueryStackTrace::fn_name_type>( lPrintedFunctionName ),
81 fn_arity,96 fn_arity,
82 call_loc.getFilename().c_str(),97 call_loc.getFilename().c_str(),
83 call_loc.getLineBegin(),98 call_loc.getLineBegin(),
8499
=== added file 'test/rbkt/ExpQueryResults/zorba/HigherOrder/hof-040.xml.res'
--- test/rbkt/ExpQueryResults/zorba/HigherOrder/hof-040.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/HigherOrder/hof-040.xml.res 2012-11-08 14:18:22 +0000
@@ -0,0 +1,1 @@
10
02
=== added file 'test/rbkt/ExpQueryResults/zorba/HigherOrder/hof-041.xml.res'
--- test/rbkt/ExpQueryResults/zorba/HigherOrder/hof-041.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/HigherOrder/hof-041.xml.res 2012-11-08 14:18:22 +0000
@@ -0,0 +1,1 @@
10
02
=== added file 'test/rbkt/Queries/zorba/HigherOrder/hof-040.xq'
--- test/rbkt/Queries/zorba/HigherOrder/hof-040.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/HigherOrder/hof-040.xq 2012-11-08 14:18:22 +0000
@@ -0,0 +1,5 @@
1declare namespace o = "http://www.zorba-xquery.com/options/features";
2declare namespace err = "http://www.w3.org/2005/xqt-errors";
3declare option o:enable "hof";
4
5try { function () { fn:error() } () } catch err:FOER0000 { 0 }
06
=== added file 'test/rbkt/Queries/zorba/HigherOrder/hof-041.xq'
--- test/rbkt/Queries/zorba/HigherOrder/hof-041.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/HigherOrder/hof-041.xq 2012-11-08 14:18:22 +0000
@@ -0,0 +1,5 @@
1declare namespace o = "http://www.zorba-xquery.com/options/features";
2declare namespace err = "http://www.w3.org/2005/xqt-errors";
3declare option o:enable "hof";
4
5try { function() { 1 div 0 } () } catch err:FOAR0001 { 0 }

Subscribers

People subscribed via source and target branches