31.08.2015, 15:46
I just can't see what is wrong in the code below
It works few times and then suddenly fails

The line 254 is the printf at the very beginning of the function. So did I corrupt the AMX?
Did some random changes to my OnFilterScriptInit which has no relationship with my INI Include but the error seems to change
Код:
stock _INI_LOG(INI:handle, msg[], {Float, _}:...) { printf("ERR MSG %s",msg); static arg_count_bytes; static str[128],start_adr,end_adr; new File:LogFile = fopen(INI_LOG_FILE,io_append); #emit LOAD.S.pri 8 #emit CONST.alt 8 //2 STATIC ARGUMENTS ; 2*4 = 8 #emit SUB #emit STOR.pri arg_count_bytes if(arg_count_bytes) { #emit LCTRL 5 #emit CONST.alt msg #emit ADD #emit STOR.pri start_adr #emit LOAD.alt arg_count_bytes #emit ADD #emit STOR.pri end_adr do { #emit LOAD.I #emit PUSH.pri #emit LOAD.pri end_adr #emit CONST.alt 4 #emit SUB #emit STOR.pri end_adr }while(end_adr > start_adr); #emit PUSH.S msg #emit PUSH.C 128 #emit PUSH.ADR str #emit LOAD.pri arg_count_bytes #emit CONST.alt 12 #emit ADD #emit STOR.pri arg_count_bytes #emit PUSH.pri #emit SYSREQ.C format #emit LOAD.pri arg_count_bytes #emit CONST.alt 4 #emit ADD #emit XCHG #emit LCTRL 4 #emit ADD #emit SCTRL 4 if(LogFile) fwrite(LogFile,str); else { print("Could not open Log File ("#INI_LOG_FILE")"); print(str); } } else { if(LogFile) { fwrite(LogFile,str); fclose(LogFile); } else { print("Could not open Log File("#INI_LOG_FILE")"); print(str); } } }
Код:
[08:42:39] ERR MSG [INI]CreateINI:File already exists(%s) [08:42:39] ERR MSG [INI]Warning:Creating another instance of the same file(%s) [08:42:39] ERR MSG [INI]ReadString:Key(%s) not found in section ID %d [08:42:39] [debug] Run time error 6: "Invalid instruction" [08:42:39] [debug] Unknown opcode 0x24000000 at address 0x00000061 [08:42:39] [debug] AMX backtrace: [08:42:39] [debug] #0 00000061 in public OnFilterScriptInit () at H:\eXtended INI Processor\Server\pawno\include\eINI.inc:254 [08:42:39] Loaded 1 filterscripts.



The line 254 is the printf at the very beginning of the function. So did I corrupt the AMX?
Did some random changes to my OnFilterScriptInit which has no relationship with my INI Include but the error seems to change
Код:
[08:50:43] -4081998 ERR MSG [INI]CreateINI:File already exists(%s) [08:50:43] [debug] Server crashed while executing TestEINI.amx [08:50:43] [debug] AMX backtrace: [08:50:43] [debug] #0 native format () [00472b80] from samp-server.exe [08:50:43] [debug] #1 000001e0 in _INI_LOG (INI:handle=-4081998, msg[]=@0x0009563c "[INI]CreateINI:File already ex...", ... <1 argument>) at H:\eXtended INI Processor\Server\pawno\include\eINI.inc:277 [08:50:43] [debug] #2 0000095c in INI:eINI_CreateINI (fname[]=@0x0009a924 "NewFile.ini") at H:\eXtended INI Processor\Server\pawno\include\eINI.inc:483 [08:50:43] [debug] #3 00011888 in public OnFilterScriptInit () at H:\eXtended INI Processor\Server\filterscripts\TestEINI.pwn:44 [08:50:43] [debug] Native backtrace: [08:50:43] [debug] #0 00403334 in ?? () from samp-server.exe [08:50:43] [debug] #1 625658ca in ?? () from plugins\crashdetect.DLL [08:50:43] [debug] #2 6256774f in ?? () from plugins\crashdetect.DLL [08:50:43] [debug] #3 62560834 in ?? () from plugins\crashdetect.DLL [08:50:43] [debug] #4 6256591a in ?? () from plugins\crashdetect.DLL [08:50:43] [debug] #5 0046a918 in ?? () from samp-server.exe
Код:
#emit ADD #emit STOR.pri end_adr do <- LINE 277 { #emit LOAD.I #emit PUSH.pri