array C_nextFree359 integer C_firstFree434 integer C_maxIndex134 array C_typeId147 integer C_firstFree434 = 0 integer C_maxIndex134 = 0 function initGlobals527() { } function main318() { initGlobals527(); init_test304(); } function config202() { } function init_test304() { local integer c167 c_167 = new_C113(); if (C_typeId_147[c_167] == 0) { if (c_167 == 0) { error124("Nullpointer exception when calling C.foo"); } else { error124("Called C.foo on invalid object."); }; } else { }; if (C_typeId_147[c_167] == 0) { if (c_167 == 0) { error124("Nullpointer exception when calling C.bar"); } else { error124("Called C.bar on invalid object."); }; } else { }; testSuccess161(); } IS_NATIVE function testSuccess161() { } function new_C113() returns integer { local integer this143 if (C_firstFree_434 == 0) { if (C_maxIndex_134 < 32768) { C_maxIndex_134 = (C_maxIndex_134 + 1); this_143 = C_maxIndex_134; C_typeId_147[this_143] = 1; } else { error124("Out of memory: Could not create C."); this_143 = 0; }; } else { C_firstFree_434 = (C_firstFree_434 - 1); this_143 = C_nextFree_359[C_firstFree_434]; C_typeId_147[this_143] = 1; }; return this_143; } function error124(string msg201) { $debugPrint291((msg_201 + (" " + #getStackTrace()))); }