Changeset: 4c8836417f5b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4c8836417f5b
Modified Files:
        monetdb5/mal/Tests/tst050.malC
        monetdb5/mal/Tests/tst050.stable.err
        monetdb5/mal/mal_session.c
        monetdb5/modules/mal/orderidx.c
Branch: default
Log Message:

A few defensive lines


diffs (98 lines):

diff --git a/monetdb5/mal/Tests/tst050.malC b/monetdb5/mal/Tests/tst050.malC
--- a/monetdb5/mal/Tests/tst050.malC
+++ b/monetdb5/mal/Tests/tst050.malC
@@ -10,15 +10,15 @@ z:bat[:int]:= bat.new(:int);
 end f;
 
 # type resolver should complain on the rest
-function f();
+function g();
 j:sht := 1:lng;
-end f;
-function f();
+end g;
+function h();
 k:lng := 1:sht;
-end f;
-function f();
+end h;
+function k();
 y:bat[:str]:= bat.new(:int);
-end f;
-function f();
-f:flt := "wrong";
-end f;
+end k;
+function l();
+l:flt := "wrong";
+end l;
diff --git a/monetdb5/mal/Tests/tst050.stable.err 
b/monetdb5/mal/Tests/tst050.stable.err
--- a/monetdb5/mal/Tests/tst050.stable.err
+++ b/monetdb5/mal/Tests/tst050.stable.err
@@ -43,24 +43,24 @@ QUERY = # Variables names may be tagged 
         end f;
         
         # type resolver should complain on the rest
-        function f();
+        function g();
         j:sht := 1:lng;
-        end f;
-        function f();
+        end g;
+        function h();
         k:lng := 1:sht;
-        end f;
-        function f();
+        end h;
+        function k();
         y:bat[:str]:= bat.new(:int);
-        end f;
-        function f();
-        f:flt := "wrong";
-        end f;
-ERROR = !TypeException:user.f[1]:type mismatch sht := lng
-        !TypeException:user.f[1]:type mismatch lng := sht
-        !TypeException:user.f[1]:'bat.new' undefined in:     y:bat[:str] := 
bat.new(:int);
-        !TypeException:user.f[1]:type mismatch flt := str
+        end k;
+        function l();
+        l:flt := "wrong";
+        end l;
+ERROR = !TypeException:user.g[1]:type mismatch sht := lng
+        !TypeException:user.h[1]:type mismatch lng := sht
+        !TypeException:user.k[1]:'bat.new' undefined in:     y:bat[:str] := 
bat.new(:int);
+        !TypeException:user.l[1]:type mismatch flt := str
 
-# 13:48:37 >  
-# 13:48:37 >  "Done."
-# 13:48:37 >  
+# 22:14:56 >  
+# 22:14:56 >  "Done."
+# 22:14:56 >  
 
diff --git a/monetdb5/mal/mal_session.c b/monetdb5/mal/mal_session.c
--- a/monetdb5/mal/mal_session.c
+++ b/monetdb5/mal/mal_session.c
@@ -601,7 +601,8 @@ MALparser(Client c)
        c->curprg->def->errors = 0;
        oldstate = *c->curprg->def;
 
-       prepareMalBlk(c->curprg->def, CURRENT(c));
+       if( prepareMalBlk(c->curprg->def, CURRENT(c)) < 0)
+               throw(MAL, "mal.parser", "Failed to prepare");
        parseMAL(c, c->curprg, 0, INT_MAX);
 
        /* now the parsing is done we should advance the stream */
diff --git a/monetdb5/modules/mal/orderidx.c b/monetdb5/modules/mal/orderidx.c
--- a/monetdb5/modules/mal/orderidx.c
+++ b/monetdb5/modules/mal/orderidx.c
@@ -110,7 +110,8 @@ OIDXcreateImplementation(Client cntxt, i
        q= addArgument(smb, q, arg);
        getArg(q,0) = newTmpVariable(smb, TYPE_void);
 
-       resizeMalBlk(smb, 2*pieces+10); // large enough
+       if( resizeMalBlk(smb, 2*pieces+10) < 0)
+               goto bailout; // large enough
        /* create the pack instruction first, as it will hold
         * intermediate variables */
        pack = newInstruction(0, putName("bat"), putName("orderidx"));
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to