Notes
This function is in beta test. Please help improve it in the issues
here.
================================================================= ==26732==ERROR: AddressSanitizer: attempting double-free on 0x60d000000040 in thread T0: #0 0x7f8a1a3c69c8 in operator delete(void*, unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xe19c8) #1 0x55f1e7179988 in Dlist<Instr>::removeAll() (/out/package/sam+0x3988) #2 0x55f1e7178f20 in Queue::~Queue() (/out/package/sam+0x2f20) #3 0x55f1e7177f50 in main (/out/package/sam+0x1f50) #4 0x7f8a19974b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) #5 0x55f1e7178639 in _start (/out/package/sam+0x2639) 0x60d000000040 is located 0 bytes inside of 136-byte region [0x60d000000040,0x60d0000000c8) freed by thread T0 here: #0 0x7f8a1a3c6480 in operator delete[](void*) (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xe1480) #1 0x55f1e7177f46 in main (/out/package/sam+0x1f46) previously allocated by thread T0 here: #0 0x7f8a1a3c5608 in operator new[](unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xe06
Hints
Your answer may be identical to the JOJ answer in the first several lines.
However, the main problem you meet now is Runtime Error. And the exit code of your program is 1, which should be 0.
Please double check your code to solve this problem and try again.
Your Answer
6 2
JOJ Answer
NOR -7 PUSHI 6 STORE NOOP PUSHI 12 LOAD PUSHI 4 STORE PUSHI 5 PUSHI 5 STORE PUSHI 15 LOAD PUSHI 0 PUSHI 15 STORE HALT 7 2 5 9 7 4 4 5 8 7 9 2 9 2 6 4 PUSHI 6 -7 6 STORE NOOP PUSHI 12 LOAD PUSHI 4 STORE PUSHI 5 PUSHI 5 STORE PUSHI 15 LOAD PUSHI 0 PUSHI 15 STORE HALT 7 2 5 9 7 4 4 5 8 7 9 2 9 2 6 4 STORE NOOP PUSHI 12 LOAD PUSHI 4 STORE PUSHI 5 PUSHI 5 STORE PUSHI 15 LOAD PUSHI 0 PUSHI 15 STORE HALT 7 2 5 9 7 4 -7 5 8 7 9 2 9 2 6 4 NOOP PUSHI 12 LOAD PUSHI 4 STORE PUSHI 5 PUSHI 5 STORE PUSHI 15 LOAD PUSHI 0 PUSHI 15 STORE HALT 7 2 5 9 7 4 -7 5 8 7 9 2 9 2 6 4 PUSHI 12 12 LOAD PUSHI 4 STORE PUSHI 5 PUSHI 5 STORE PUSHI 15 LOAD PUSHI 0 PUSHI 15 STORE HALT 7 2 5 9 7 4 -7 5 8 7 9 2 9 2 6 4 LOAD 9 PUSHI 4 STORE PUSHI 5 PUSHI 5 STORE PUSHI 15 LOAD PUSHI 0 PUSHI 15 STORE HALT 7 2 5 9 7 4 -7 5 8 7 9 2 9 2 6 4 PUSHI 4 9 4 STORE PUSHI 5 PUSHI 5 STORE PUSHI 15 LOAD PUSHI 0 PUSHI 15 STORE HALT 7 2 5 9 7 4 -7 5 8 7 9 2 9 2 6 4 STORE PUSHI 5 PUSHI 5 STORE PUSHI 15 LOAD PUSHI 0 PUSHI 15 STORE HALT 7 2 5