← Back to team overview

zorba-coders team mailing list archive

[Merge] lp:~zorba-coders/zorba/bug-empty_array_constr into lp:zorba

 

Matthias Brantner has proposed merging lp:~zorba-coders/zorba/bug-empty_array_constr into lp:zorba.

Commit message:
fix bug when cloning an empty array expr.

Requested reviews:
  Matthias Brantner (matthias-brantner)
  Markos Zaharioudakis (markos-za)

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/bug-empty_array_constr/+merge/154781
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug-empty_array_constr/+merge/154781
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'src/compiler/expression/expr_clone.cpp'
--- src/compiler/expression/expr_clone.cpp	2013-03-05 12:34:19 +0000
+++ src/compiler/expression/expr_clone.cpp	2013-03-21 18:16:32 +0000
@@ -204,7 +204,8 @@
     create_json_array_expr(theSctx,
                            udf,
                            theLoc,
-                           e->theContentExpr->clone(udf, subst));
+                           (e->theContentExpr ?
+                            e->theContentExpr->clone(udf, subst) : NULL));
 
     break;
   }

=== added file 'test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_31.xml.res'
--- test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_31.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_31.xml.res	2013-03-21 18:16:32 +0000
@@ -0,0 +1,1 @@
+[  ]

=== added file 'test/rbkt/Queries/zorba/jsoniq/arr_constr_31.xq'
--- test/rbkt/Queries/zorba/jsoniq/arr_constr_31.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/jsoniq/arr_constr_31.xq	2013-03-21 18:16:32 +0000
@@ -0,0 +1,3 @@
+declare function local:foo() { [] };
+
+local:foo()


Follow ups