fix: correctly initialize FunInfo<> object when calling a model field
This commit is contained in:
parent
369cefacdf
commit
5814bfca0d
|
@ -5,7 +5,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007-2016, Tomasz Sowa
|
* Copyright (c) 2007-2023, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -201,7 +201,7 @@ struct FunInfo
|
||||||
// for other statements than [for] this is always zero
|
// for other statements than [for] this is always zero
|
||||||
size_t iter;
|
size_t iter;
|
||||||
|
|
||||||
//
|
// an item from the tree
|
||||||
const Item & item;
|
const Item & item;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007-2021, Tomasz Sowa
|
* Copyright (c) 2007-2023, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -1652,12 +1652,14 @@ bool Generator<StreamType, is_pikotools_stream, is_autoescape_stream>::CallModel
|
||||||
if( parameters.empty() )
|
if( parameters.empty() )
|
||||||
{
|
{
|
||||||
FunInfo<StreamType> info(out_stream, parameters, empty, in_stream, stack_tab[stack_index-1], *stack_tab[stack_index-1].item);
|
FunInfo<StreamType> info(out_stream, parameters, empty, in_stream, stack_tab[stack_index-1], *stack_tab[stack_index-1].item);
|
||||||
|
PrepareEnvStruct(info);
|
||||||
found = model.get_raw_value(nullptr, field.c_str(), nullptr, info, str, false);
|
found = model.get_raw_value(nullptr, field.c_str(), nullptr, info, str, false);
|
||||||
last_res = info.res;
|
last_res = info.res;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FunInfo<StreamType> info(out_stream, parameters, parameters[0].str, in_stream, stack_tab[stack_index-1], *stack_tab[stack_index-1].item);
|
FunInfo<StreamType> info(out_stream, parameters, parameters[0].str, in_stream, stack_tab[stack_index-1], *stack_tab[stack_index-1].item);
|
||||||
|
PrepareEnvStruct(info);
|
||||||
found = model.get_raw_value(nullptr, field.c_str(), nullptr, info, str, false);
|
found = model.get_raw_value(nullptr, field.c_str(), nullptr, info, str, false);
|
||||||
last_res = info.res;
|
last_res = info.res;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue