libexpr: heap-allocate "large" integers

Change-Id: Ic391f2f1bf87f044d7a688196ba9e0ad766d65aa
This commit is contained in:
eldritch horrors
2025-10-04 16:31:45 +02:00
parent 79586575c5
commit 0e9e9fd917
8 changed files with 67 additions and 21 deletions
+2 -2
View File
@@ -148,7 +148,7 @@ struct ExprState
std::unique_ptr<Expr> negate(PosIdx pos, State & state)
{
std::vector<std::unique_ptr<Expr>> args(2);
args[0] = std::make_unique<ExprLiteral>(pos, NewValueAs::integer, 0);
args[0] = std::make_unique<ExprInt>(pos, 0);
args[1] = popExprOnly();
return std::make_unique<ExprCall>(pos, state.mkInternalVar(pos, state.s.sub), std::move(args));
}
@@ -507,7 +507,7 @@ template<> struct BuildAST<grammar::v1::expr::int_> {
.pos = ps.positions[ps.at(in)],
});
}
s.emplaceExpr<ExprLiteral>(ps.at(in), NewValueAs::integer, v);
s.emplaceExpr<ExprInt>(ps.at(in), v);
}
};