Skip to content

Commit be57edf

Browse files
committed
Fix un-initialized members of ASTfunction_call.
Move all initialization into constructor so some compilers can error on regression.
1 parent 6c2649b commit be57edf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/liboslcomp/ast.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,14 +1025,14 @@ ASTtype_constructor::childname (size_t i) const
10251025
ASTfunction_call::ASTfunction_call (OSLCompilerImpl *comp, ustring name,
10261026
ASTNode *args, FunctionSymbol *funcsym)
10271027
: ASTNode (function_call_node, comp, 0, args), m_name(name),
1028+
m_sym(funcsym ? funcsym : comp->symtab().find (name)), // Look it up.
1029+
m_poly(funcsym), // Default - resolved symbol or null
10281030
m_argread(~1), // Default - all args are read except the first
10291031
m_argwrite(1), // Default - first arg only is written by the op
10301032
m_argtakesderivs(0) // Default - doesn't take derivs
10311033
{
1032-
// If we weren't passed a function symbol directly, look it up.
1033-
m_sym = funcsym ? funcsym : comp->symtab().find (name);
10341034
if (! m_sym) {
1035-
error ("function '%s' was not declared in this scope", name.c_str());
1035+
error ("function '%s' was not declared in this scope", name);
10361036
// FIXME -- would be fun to troll through the symtab and try to
10371037
// find the things that almost matched and offer suggestions.
10381038
return;

0 commit comments

Comments
 (0)