瀏覽代碼

HPCC-20764 Fix invalid c++ generated from hashing an integer6

Only occurs in very unusual situations where the value is serialized
from a parent activity to a child activity.

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 6 年之前
父節點
當前提交
905fd6ccd8
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      ecl/hqlcpp/hqlcpp.cpp

+ 5 - 0
ecl/hqlcpp/hqlcpp.cpp

@@ -2347,6 +2347,8 @@ bool HqlCppTranslator::hasAddress(BuildCtx & ctx, IHqlExpression * expr)
         }
     case no_typetransfer:
         return hasAddress(ctx, expr->queryChild(0));
+    case no_constant:
+        return isTypePassedByAddress(expr->queryType());
     default:
         return false;
     }
@@ -4577,6 +4579,9 @@ void HqlCppTranslator::buildTempExpr(BuildCtx & ctx, IHqlExpression * expr, CHql
     if (op == no_alias)
     {
         doBuildExprAlias(ctx, expr, &tgt, NULL);
+        //very unusually an alias may generate a function call (e.g., for an int6 - this ensures it is forced into a variable).
+        if (!hasAddress(ctx, tgt.expr))
+            ensureHasAddress(ctx, tgt);
         return;
     }