fix stupid bug in AtC when using alloca() instead of VLAs

This commit is contained in:
Axel Kohlmeyer
2018-05-10 17:42:10 -04:00
parent 33a41a4fb3
commit 40a8b1af79

View File

@ -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);