Changeset: 40eed3059556 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=40eed3059556
Modified Files:
        monetdb5/mal/mal_instruction.mx
        monetdb5/mal/mal_interpreter.mx
        monetdb5/mal/mal_resolve.mx
        monetdb5/modules/kernel/algebra.mx
Branch: default
Log Message:

Merge with Dec2011 branch.


diffs (139 lines):

diff --git a/HowToStart.rst b/HowToStart.rst
--- a/HowToStart.rst
+++ b/HowToStart.rst
@@ -108,12 +108,18 @@ pcre
     monetdb5 and sql.  Most prominently, complex SQL LIKE expressions are
     evaluated with help of the pcre library.
 
+openssl
+    The `OpenSSL`__ toolkit implementing SSL v2/v3 and TLS protocols is used
+    for its with full-strength world-wide cryptography functions.  The
+    client-server login procedures make use of these functions.
+
 __ http://dev.monetdb.org/downloads/sources/
 __ http://www.gnu.org/software/autoconf/
 __ http://www.gnu.org/software/automake/
 __ http://www.gnu.org/software/libtool/
 __ http://www.xmlsoft.org/
 __ http://www.pcre.org/
+__ http://www.openssl.org/
 
 Space Requirements
 ~~~~~~~~~~~~~~~~~~
@@ -207,7 +213,6 @@ Some other useful ``configure`` options 
 --enable-optimize       enable extra optimization default=[see `Configure 
defaults and recommendations`_ below]
 --enable-assert         enable assertions in the code default=[see `Configure 
defaults and recommendations`_ below]
 --enable-strict         enable strict compiler flags default=[see `Configure 
defaults and recommendations`_ below]
---enable-warning        enable extended compiler warnings default=off
 
 You can also add options such as ``CC=<compiler>`` to specify the
 compiler and compiler flags to use.
diff --git a/monetdb5/ChangeLog.Dec2011 b/monetdb5/ChangeLog.Dec2011
--- a/monetdb5/ChangeLog.Dec2011
+++ b/monetdb5/ChangeLog.Dec2011
@@ -1,3 +1,6 @@
 # ChangeLog file for MonetDB5
 # This file is updated with Maddlog
 
+* Thu Feb  9 2012 Sjoerd Mullender <[email protected]>
+- Fixed potential crash by dealing better with non-standard types.
+
diff --git a/monetdb5/mal/mal_instruction.mx b/monetdb5/mal/mal_instruction.mx
--- a/monetdb5/mal/mal_instruction.mx
+++ b/monetdb5/mal/mal_instruction.mx
@@ -1756,8 +1756,7 @@ defConstant(MalBlkPtr mb, int type, ValP
        k = newTmpVariable(mb, type);
        setVarConstant(mb, k);
        setVarFixed(mb, k);
-       if (type == TYPE_str ||
-               (type >= 0 && type < TYPE_any && BATatoms[type].atomDestroy))
+       if (type >= 0 && type < TYPE_any && ATOMextern(type))
                setVarCleanup(mb, k);
        else clrVarCleanup(mb, k);
        vr = &getVarConstant(mb, k);
diff --git a/monetdb5/mal/mal_interpreter.mx b/monetdb5/mal/mal_interpreter.mx
--- a/monetdb5/mal/mal_interpreter.mx
+++ b/monetdb5/mal/mal_interpreter.mx
@@ -1853,10 +1853,9 @@ safeguardStack(Client cntxt, MalBlkPtr m
                                stamp = BBPcurstamp();
 #endif
                        } else if (i < pci->retc &&
-                                          (stk->stk[a].vtype == TYPE_str ||
-                                               (0 < stk->stk[a].vtype &&
-                                                stk->stk[a].vtype < TYPE_any &&
-                                                
BATatoms[stk->stk[a].vtype].atomDestroy))) {
+                                          0 < stk->stk[a].vtype &&
+                                          stk->stk[a].vtype < TYPE_any &&
+                                          ATOMextern(stk->stk[a].vtype)) {
                                backup[i] = stk->stk[a];
                        }
                }
@@ -1925,13 +1924,13 @@ safeguardStack(Client cntxt, MalBlkPtr m
                        } else if (i < pci->retc &&
                                           0 < stk->stk[a].vtype &&
                                           stk->stk[a].vtype < TYPE_any &&
-                                          
BATatoms[stk->stk[a].vtype].atomDestroy) {
+                                          ATOMextern(stk->stk[a].vtype)) {
                                if (backup[i].val.pval &&
                                        backup[i].val.pval != 
stk->stk[a].val.pval) {
                                        if (backup[i].val.pval)
-                                               
(*BATatoms[stk->stk[a].vtype].atomDestroy)(backup[i].val.pval);
+                                               GDKfree(backup[i].val.pval);
                                        if (i >= pci->retc) {
-                                               stk->stk[a].val.sval = 0;
+                                               stk->stk[a].val.pval = 0;
                                                stk->stk[a].len = 0;
                                        }
                                        backup[i].len = 0;
@@ -2470,10 +2469,11 @@ void garbageElement(Client cntxt, ValPtr
                if (cntxt && cntxt->flags & bigfootFlag)
                        updateBigFoot(cntxt, bid, FALSE);
                BBPdecref(bid, TRUE);
-       } else if (0 < v->vtype && v->vtype < TYPE_any &&
-                          BATatoms[v->vtype].atomDestroy) {
-               (*BATatoms[v->vtype].atomDestroy)(v->val.pval);
+       } else if (0 < v->vtype && v->vtype < TYPE_any && ATOMextern(v->vtype)) 
{
+               if (v->val.pval)
+                       GDKfree(v->val.pval);
                v->val.pval = 0;
+               v->len = 0;
        }
 }
 /*
diff --git a/monetdb5/mal/mal_resolve.mx b/monetdb5/mal/mal_resolve.mx
--- a/monetdb5/mal/mal_resolve.mx
+++ b/monetdb5/mal/mal_resolve.mx
@@ -529,8 +529,7 @@ findFunctionType(Module scope, MalBlkPtr
                isaBatType(@1) ||
                findGDKtype(@1) == TYPE_str ||
                (!isPolyType(@1) && @1 < TYPE_any &&
-                @1 >= 0 && (ATOMstorage(@1) == TYPE_str ||
-                                        BATatoms[@1].atomDestroy))) {
+                @1 >= 0 && ATOMextern(@1))) {
                getInstrPtr(@3, 0)->gc |= GARBAGECONTROL;
                setVarCleanup(mb, getArg(p, @2));
                p->gc |= GARBAGECONTROL;
@@ -785,8 +784,7 @@ void typeChecker(Module scope, MalBlkPtr
                if (findGDKtype(tpe) == TYPE_bat ||
                        findGDKtype(tpe) == TYPE_str ||
                        (!isPolyType(tpe) && tpe< TYPE_any &&
-                        (ATOMstorage(tpe) == TYPE_str ||
-                         BATatoms[tpe].atomDestroy)))
+                        ATOMextern(tpe)))
                        setVarCleanup(mb,getArg(p,k));
        }
 }
diff --git a/monetdb5/modules/kernel/algebra.mx 
b/monetdb5/modules/kernel/algebra.mx
--- a/monetdb5/modules/kernel/algebra.mx
+++ b/monetdb5/modules/kernel/algebra.mx
@@ -1852,8 +1852,8 @@ CMDpositionBUN(wrd *retval, BAT *b, ptr 
 }
 
 @= putTail
-       if (b->ttype && b->T->vheap) {
-               ptr _src = BUNtvar(bi,@1);
+       if (ATOMextern(b->ttype)) {
+               ptr _src = BUNtail(bi,@1);
                int _len = ATOMlen(b->ttype, _src);
                ptr _dst = GDKmalloc(_len);
                memcpy(_dst, _src, _len);
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to