array C_nextFree171 integer C_firstFree196 integer C_maxIndex172 array C_typeId672 integer C_firstFree196 = 0 integer C_maxIndex172 = 0 function initGlobals186() { } function main895() { initGlobals186(); init_test168(); } function config322() { } function init_test168() { local integer c145 c_145 = new_C426(1); if (C_typeId_672[c_145] == 0) { if (c_145 == 0) { error242("Nullpointer exception when calling C.foo"); } else { error242("Called C.foo on invalid object."); }; } else { }; new_C426(1); if (C_typeId_672[c_145] == 0) { if (c_145 == 0) { error242("Nullpointer exception when calling C.foo"); } else { error242("Called C.foo on invalid object."); }; } else { }; testSuccess172(); } IS_NATIVE function testSuccess172() { } function new_C426(any x812) returns integer { local integer this144 if (C_firstFree_196 == 0) { if (C_maxIndex_172 < 32768) { C_maxIndex_172 = (C_maxIndex_172 + 1); this_144 = C_maxIndex_172; C_typeId_672[this_144] = 1; } else { error242("Out of memory: Could not create C."); this_144 = 0; }; } else { C_firstFree_196 = (C_firstFree_196 - 1); this_144 = C_nextFree_171[C_firstFree_196]; C_typeId_672[this_144] = 1; }; return this_144; } function error242(string msg199) { $debugPrint183((msg_199 + (" " + #getStackTrace()))); }