Hi,
When I have this line in a script: `auto compoundData = data.compounds[compound.internalName];` I get a segmentation fault.
Here:
0 in asCArray<int>::GetLength() const of /home/hhyyrylainen/Projects/thrive/build/bin/libEngine.so
1 in asCCompiler::CompileOverloadedDualOperator2(asCScriptNode*, char const*, asCExprContext*, asCExprContext*, bool, asCExprContext*, bool, asCDataType const&) of /home/hhyyrylainen/Projects/thrive/build/bin/libEngine.so
2 in asCCompiler::CompileOperatorOnHandles(asCScriptNode*, asCExprContext*, asCExprContext*, asCExprContext*, eTokenType) of /home/hhyyrylainen/Projects/thrive/build/bin/libEngine.so
3 in asCCompiler::CompileOperator(asCScriptNode*, asCExprContext*, asCExprContext*, asCExprContext*, eTokenType, bool) of /home/hhyyrylainen/Projects/thrive/build/bin/libEngine.so
4 in asCCompiler::CompilePostFixExpression(asCArray<asCScriptNode*>*, asCExprContext*) of /home/hhyyrylainen/Projects/thrive/build/bin/libEngine.so
5 in asCCompiler::CompileExpression(asCScriptNode*, asCExprContext*) of /home/hhyyrylainen/Projects/thrive/build/bin/libEngine.so
6 in asCCompiler::CompileCondition(asCScriptNode*, asCExprContext*) of /home/hhyyrylainen/Projects/thrive/build/bin/libEngine.so
7 in asCCompiler::CompileAssignment(asCScriptNode*, asCExprContext*) of /home/hhyyrylainen/Projects/thrive/build/bin/libEngine.so
8 in asCCompiler::CompileIfStatement(asCScriptNode*, bool*, asCByteCode*) of /home/hhyyrylainen/Projects/thrive/build/bin/libEngine.so
9 in asCCompiler::CompileStatement(asCScriptNode*, bool*, asCByteCode*) of /home/hhyyrylainen/Projects/thrive/build/bin/libEngine.so
10 in asCCompiler::CompileStatementBlock(asCScriptNode*, bool, bool*, asCByteCode*) of /home/hhyyrylainen/Projects/thrive/build/bin/libEngine.so
11 in asCCompiler::CompileStatement(asCScriptNode*, bool*, asCByteCode*) of /home/hhyyrylainen/Projects/thrive/build/bin/libEngine.so
12 in asCCompiler::CompileForStatement(asCScriptNode*, asCByteCode*) of /home/hhyyrylainen/Projects/thrive/build/bin/libEngine.so
13 in asCCompiler::CompileStatement(asCScriptNode*, bool*, asCByteCode*) of /home/hhyyrylainen/Projects/thrive/build/bin/libEngine.so
14 in asCCompiler::CompileStatementBlock(asCScriptNode*, bool, bool*, asCByteCode*) of /home/hhyyrylainen/Projects/thrive/build/bin/libEngine.so
15 in asCCompiler::CompileStatement(asCScriptNode*, bool*, asCByteCode*) of /home/hhyyrylainen/Projects/thrive/build/bin/libEngine.so
16 in asCCompiler::CompileForStatement(asCScriptNode*, asCByteCode*) of /home/hhyyrylainen/Projects/thrive/build/bin/libEngine.so
17 in asCCompiler::CompileStatement(asCScriptNode*, bool*, asCByteCode*) of /home/hhyyrylainen/Projects/thrive/build/bin/libEngine.so
18 in asCCompiler::CompileStatementBlock(asCScriptNode*, bool, bool*, asCByteCode*) of /home/hhyyrylainen/Projects/thrive/build/bin/libEngine.so
19 in asCCompiler::CompileFunction(asCBuilder*, asCScriptCode*, asCArray<asCString>&, asCScriptNode*, asCScriptFunction*, sClassDeclaration*) of /home/hhyyrylainen/Projects/thrive/build/bin/libEngine.so
20 in asCBuilder::CompileFunctions() of /home/hhyyrylainen/Projects/thrive/build/bin/libEngine.so
21 in asCBuilder::Build() of /home/hhyyrylainen/Projects/thrive/build/bin/libEngine.so
22 in asCModule::Build() of /home/hhyyrylainen/Projects/thrive/build/bin/libEngine.so
23 in CScriptBuilder::Build of /home/hhyyrylainen/Projects/leviathan/build/ThirdParty/include/add_on/scriptbuilder/scriptbuilder.cpp:520
24 in CScriptBuilder::BuildModule of /home/hhyyrylainen/Projects/leviathan/build/ThirdParty/include/add_on/scriptbuilder/scriptbuilder.cpp:117
If I change the line to (change auto to int): `int compoundData = data.compounds[compound.internalName];` I get an compile error "Can't implicitly convert from 'dictionaryValue' to 'int'" instead of a segmentation fault.
I know that the above example shouldn't compile either, but it would be nice to have an error message instead of a crash.