Crash when instantiating dictionary with null value

Started by
1 comment, last by WitchLord 9 years, 9 months ago

The following code


dictionary sprites = { {'easing_parent', null} };

results in a hard crash of the application.

When the snippet is a global variable, the backtrace (Linux, 32-bit) is as follows:


0x09093893 in asCCompiler::DoAssignment (this=0xbf8e8874, ctx=0xbf8e6438, lctx=0xbf8e624c, rctx=0xbf8e62f0, lexpr=0xc80f75c, rexpr=0xc80f75c, op=37, opNode=0xc80f75c) at AngelScript/source/as_compiler.cpp:7373
0x090ac9ed in asCCompiler::CompileInitListElement (this=0xbf8e8874, patternNode=@0xbf8e7e4c: 0xaf90bdc, valueNode=@0xbf8e68c0: 0xc80f75c, bufferTypeId=67108924, bufferVar=1, bufferSize=@0xbf8e7e44: 12, byteCode=..., elementsInSubList=@0xbf8e6fe4: -1) at AngelScript/source/as_compiler.cpp:3340
0x090ac6a7 in asCCompiler::CompileInitListElement (this=0xbf8e8874, patternNode=@0xbf8e7e4c: 0xaf90bdc, valueNode=@0xbf8e7700: 0xc80f87c, bufferTypeId=67108924, bufferVar=1, bufferSize=@0xbf8e7e44: 12, byteCode=..., elementsInSubList=@0xbf8e6fe4: -1) at AngelScript/source/as_compiler.cpp:3148
0x090ad016 in asCCompiler::CompileInitListElement (this=0xbf8e8874, patternNode=@0xbf8e7e4c: 0xaf90bdc, valueNode=@0xbf8e7700: 0xc80f87c, bufferTypeId=67108924, bufferVar=1, bufferSize=@0xbf8e7e44: 12, byteCode=..., elementsInSubList=@0xbf8e7e50: -1) at AngelScript/source/as_compiler.cpp:3192
0x090ac6a7 in asCCompiler::CompileInitListElement (this=0xbf8e8874, patternNode=@0xbf8e7e4c: 0xaf90bdc, valueNode=@0xbf8e7e48: 0xc57b774, bufferTypeId=67108924, bufferVar=1, bufferSize=@0xbf8e7e44: 12, byteCode=..., elementsInSubList=@0xbf8e7e50: -1) at AngelScript/source/as_compiler.cpp:3148
0x090ae015 in asCCompiler::CompileInitList (this=0xbf8e8874, var=0xbf8e8190, node=0xc57b774, bc=0xbf8e86c4, isVarGlobOrMem=1) at AngelScript/source/as_compiler.cpp:3002
0x090af55c in asCCompiler::CompileInitialization (this=0xbf8e8874, node=0xc57b774, bc=0xbf8e86c4, type=..., errNode=0xc7ea304, offset=50, constantValue=0xbf8e8618, isVarGlobOrMem=1, preCompiled=0x0) at AngelScript/source/as_compiler.cpp:2767
0x090b12aa in asCCompiler::CompileGlobalVariable (this=0xbf8e8874, builder=0xc7f8ffc, script=0xc7f912c, node=0xc57b774, gvar=0xc7f6554, outFunc=0xc7f5dd4) at AngelScript/source/as_compiler.cpp:1196
0x0907795a in asCBuilder::CompileGlobalVariables (this=0xc7f8ffc) at AngelScript/source/as_builder.cpp:1938
0x0907877e in asCBuilder::Build (this=0xc7f8ffc) at AngelScript/source/as_builder.cpp:237
0x090c0e2d in Build (this=0xc57f7cc) at AngelScript/source/as_module.cpp:275
asCModule::Build (this=0xc57f7cc) at AngelScript/source/as_module.cpp:245

When it is a variable in a function, the backtrace is as follows:


0x09093893 in asCCompiler::DoAssignment (this=0xbfb926a0, ctx=0xbfb900c8, lctx=0xbfb8fedc, rctx=0xbfb8ff80, lexpr=0xbb0aa2c, rexpr=0xbb0aa2c, op=37, opNode=0xbb0aa2c) at AngelScript/source/as_compiler.cpp:7373
0x090ac9ed in asCCompiler::CompileInitListElement (this=0xbfb926a0, patternNode=@0xbfb91adc: 0xa3a3bdc, valueNode=@0xbfb90550: 0xbb0aa2c, bufferTypeId=67108922, bufferVar=2, bufferSize=@0xbfb91ad4: 12, byteCode=..., elementsInSubList=@0xbfb90c74: -1) at AngelScript/source/as_compiler.cpp:3340
0x090ac6a7 in asCCompiler::CompileInitListElement (this=0xbfb926a0, patternNode=@0xbfb91adc: 0xa3a3bdc, valueNode=@0xbfb91390: 0xbb0a8dc, bufferTypeId=67108922, bufferVar=2, bufferSize=@0xbfb91ad4: 12, byteCode=..., elementsInSubList=@0xbfb90c74: -1) at AngelScript/source/as_compiler.cpp:3148
0x090ad016 in asCCompiler::CompileInitListElement (this=0xbfb926a0, patternNode=@0xbfb91adc: 0xa3a3bdc, valueNode=@0xbfb91390: 0xbb0a8dc, bufferTypeId=67108922, bufferVar=2, bufferSize=@0xbfb91ad4: 12, byteCode=..., elementsInSubList=@0xbfb91ae0: -1) at AngelScript/source/as_compiler.cpp:3192
0x090ac6a7 in asCCompiler::CompileInitListElement (this=0xbfb926a0, patternNode=@0xbfb91adc: 0xa3a3bdc, valueNode=@0xbfb91ad8: 0xbb0a8ac, bufferTypeId=67108922, bufferVar=2, bufferSize=@0xbfb91ad4: 12, byteCode=..., elementsInSubList=@0xbfb91ae0: -1) at AngelScript/source/as_compiler.cpp:3148
0x090ae015 in asCCompiler::CompileInitList (this=0xbfb926a0, var=0xbfb91e20, node=0xbb0a8ac, bc=0xbfb92480, isVarGlobOrMem=0) at AngelScript/source/as_compiler.cpp:3002
0x090af55c in asCCompiler::CompileInitialization (this=0xbfb926a0, node=0xbb0a8ac, bc=0xbfb92480, type=..., errNode=0xbb0a87c, offset=1, constantValue=0xbfb922c0, isVarGlobOrMem=0, preCompiled=0x0) at AngelScript/source/as_compiler.cpp:2767
0x090b0ae7 in asCCompiler::CompileDeclaration (this=0xbfb926a0, decl=0xbb0a90c, bc=0xbfb92480) at AngelScript/source/as_compiler.cpp:2596
0x090b9b58 in asCCompiler::CompileStatementBlock (this=0xbfb926a0, block=0xa38d54c, ownVariableScope=false, hasReturn=0xbfb9254f, bc=0xbfb92550) at AngelScript/source/as_compiler.cpp:1119
0x090b9e43 in asCCompiler::CompileFunction (this=0xbfb926a0, builder=0xbaef1a4, script=0xbaef33c, parameterNames=..., func=0xbb03194, outFunc=0xb93122c, classDecl=0x0) at AngelScript/source/as_compiler.cpp:553
0x09066d47 in asCBuilder::CompileFunctions (this=0xbaef1a4) at AngelScript/source/as_builder.cpp:735
0x09078796 in asCBuilder::Build (this=0xbaef1a4) at AngelScript/source/as_builder.cpp:240
0x090c0e2d in Build (this=0xbaf7b14) at AngelScript/source/as_module.cpp:275
asCModule::Build (this=0xbaf7b14) at AngelScript/source/as_module.cpp:245

Version 2.29.2 WIP - 2014/07/21. Rev 1985 (with some minor local modifications to support handle-of-handle syntax for backwards compatibility).

Advertisement

Thanks. I must have missed testing with null in the initialization list.

I'll have this corrected as soon as possible.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Fixed in revision 1993.

Regards,

Andreas

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement