Changeset: ffe6cee3aa4a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ffe6cee3aa4a
Modified Files:
        monetdb5/mal/mal_parser.c
Branch: default
Log Message:

protect more failing constant definitions


diffs (43 lines):

diff --git a/monetdb5/mal/mal_parser.c b/monetdb5/mal/mal_parser.c
--- a/monetdb5/mal/mal_parser.c
+++ b/monetdb5/mal/mal_parser.c
@@ -876,12 +876,16 @@ term(Client cntxt, MalBlkPtr curBlk, Ins
                                        setVarUDFtype(curBlk, cstidx);
                                } else {
                                        cstidx = defConstant(curBlk, tpe, &cst);
+                                       if (cstidx < 0)
+                                               return 3;
                                        setPolymorphic(*curInstr, tpe, FALSE);
                                        setVarUDFtype(curBlk, cstidx);
                                        free = 0;
                                }
                        } else if (cst.vtype != getVarType(curBlk, cstidx)) {
                                cstidx = defConstant(curBlk, cst.vtype, &cst);
+                               if (cstidx < 0)
+                                       return 3;
                                setPolymorphic(*curInstr, cst.vtype, FALSE);
                                free = 0;
                        }
@@ -897,6 +901,8 @@ term(Client cntxt, MalBlkPtr curBlk, Ins
                        if (tpe < 0)
                                return 3;
                        cstidx = defConstant(curBlk, tpe, &cst);
+                       if (cstidx < 0)
+                               return 3;
                        setPolymorphic(*curInstr, tpe, FALSE);
                        if (flag)
                                setVarUDFtype(curBlk, cstidx);
@@ -1809,7 +1815,12 @@ parseMAL(Client cntxt, Symbol curPrg, in
                                        freeInstruction(curInstr);
                                        continue;
                                }
-                               getArg(curInstr, 0) = defConstant(curBlk, 
TYPE_str, &cst);
+                               int cstidx = defConstant(curBlk, TYPE_str, 
&cst);
+                               if (cstidx < 0) {
+                                       freeInstruction(curInstr);
+                                       continue;
+                               }
+                               getArg(curInstr, 0) = cstidx;
                                clrVarConstant(curBlk, getArg(curInstr, 0));
                                setVarDisabled(curBlk, getArg(curInstr, 0));
                                pushInstruction(curBlk, curInstr);
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to