瀏覽代碼

HPCC-17141 Fix -ve memory leak processing bitfields

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 8 年之前
父節點
當前提交
0559a0d7db
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      common/deftype/defvalue.cpp
  2. 1 1
      ecl/hql/hqllex.l

+ 1 - 1
common/deftype/defvalue.cpp

@@ -117,7 +117,7 @@ int rangeCompare(double value, ITypeInfo * targetType)
             return rangeCompare(value, targetType->queryPromotedType());
         case type_bitfield:
             {
-                unsigned __int64 maxValue = (I64C(1) << targetType->getBitSize()) - 1;
+                unsigned __int64 maxValue = (U64C(1) << targetType->getBitSize()) - 1;
                 if (value > maxValue)
                     return +1;
                 break;

+ 1 - 1
ecl/hql/hqllex.l

@@ -1334,7 +1334,7 @@ BITFIELD{digit}+    {
                       }
 
                       Owned<ITypeInfo> int64 = makeIntType(8, false);
-                      ITypeInfo * type = makeBitfieldType(size, int64);
+                      ITypeInfo * type = makeBitfieldType(size, int64.getClear());
                       assert(type!=NULL);
 
                       returnToken.setType(type);