From 40a8b1af79cf7984615224fcedc6d176674718d9 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer <akohlmey@gmail.com> Date: Thu, 10 May 2018 17:42:10 -0400 Subject: [PATCH] fix stupid bug in AtC when using alloca() instead of VLAs --- lib/atc/Function.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/atc/Function.cpp b/lib/atc/Function.cpp index dfc42d5148..fb615e7bef 100644 --- a/lib/atc/Function.cpp +++ b/lib/atc/Function.cpp @@ -59,7 +59,7 @@ namespace ATC { { string type = args[0]; int narg = nargs -1; - double *dargs = alloca(sizeof(double) * narg); + double *dargs = (double *) alloca(sizeof(double) * narg); for (int i = 0; i < narg; ++i) dargs[i] = atof(args[i+1]); return function(type, narg, dargs); @@ -193,7 +193,7 @@ XT_Function_Mgr * XT_Function_Mgr::myInstance_ = NULL; { string type = args[0]; int narg = nargs -1; - double *dargs = alloca(sizeof(double) * narg); + double *dargs = (double *) alloca(sizeof(double) * narg); for (int i = 0; i < narg; ++i) dargs[i] = atof(args[i+1]); return function(type, narg, dargs); -- GitLab