Notes
This function is in beta test. Please help improve it in the issues
here.
================================================================= ==33204==ERROR: LeakSanitizer: detected memory leaks Direct leak of 1696 byte(s) in 212 object(s) allocated from: #0 0x7f85ae6da448 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xe0448) #1 0x55f42decee8f in main (/out/package/sam_mem+0x18e8f) Direct leak of 100 byte(s) in 25 object(s) allocated from: #0 0x7f85ae6da448 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xe0448) #1 0x55f42ded0387 in load(Stack<int>&, int*) (/out/package/sam_mem+0x1a387) Direct leak of 56 byte(s) in 14 object(s) allocated from: #0 0x7f85ae6da448 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xe0448) #1 0x55f42ded0508 in pushi(Stack<int>&, Instr*) (/out/package/sam_mem+0x1a508) Direct leak of 32 byte(s) in 8 object(s) allocated from: #0 0x7f85ae6da448 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xe0448) #1 0x55f42ded0001 in add(Stac
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
IFZ 17 65497387 68090939 14401102 96824012 41289437 4835457 56117097 24136017 47420903 22807055 69570787 62885835 57250385 74993225 41595224 13915356 73942021 42769129 85990319 521962 99845127 33369678 82969071 ADD POP POP NOR NOR PUSHI 5 STORE ADD POP PUSHI 5 STORE NOOP PUSHI 8 LOAD PUSHI 14 LOAD POP ADD PUSHI 909323973 PUSHI 5 STORE IFZ 24 IFZ 20 ADD PUSHI 13 STORE NOOP POP PUSHI 895499513 NOOP PUSHI 11 LOAD PUSHI 5 STORE IFZ 13 NOOP PUSHI 8 LOAD PUSHI 0 IFZ 15 HALT STORE POP ADD IFZ 11 ADD HALT LOAD HALT NOOP HALT STORE ADD NOR STORE PUSHI 0 IFZ 3 STORE IFZ 25 HALT NOOP PUSHI 13 STORE IFZ 14 ADD NOOP PUSHI 3 LOAD NOR ADD PUSHI 3 LOAD PUSHI 3 STORE NOR NOOP POP IFZ 7 PUSHI 2 LOAD ADD PUSHI 8 STORE POP PUSHI 12 LOAD ADD POP PUSHI 2 LOAD NOOP NOOP PUSHI 6 STORE NOOP PUSHI 1912752084 IFZ 7 PUSHI 7 LOAD PUSHI 1235035345 POP PUSHI 6 STORE PUSHI 1 LOAD PUSHI 4 STORE PUSHI 533965038 PUSHI 3 LOAD NOOP PUSHI 7 LOAD NOOP NOOP POP NOR POP NOOP NOOP NOOP PUSHI 7 LOAD PUSHI 13 STORE PUSHI 8 LOAD NOOP POP NOOP PUSHI 152
JOJ Answer
IFZ 17 65497387 68090939 14401102 96824012 41289437 4835457 56117097 24136017 47420903 22807055 69570787 62885835 57250385 74993225 41595224 13915356 73942021 42769129 85990319 521962 99845127 33369678 82969071 ADD POP POP NOR NOR PUSHI 5 STORE ADD POP PUSHI 5 STORE NOOP PUSHI 8 LOAD PUSHI 14 LOAD POP ADD PUSHI 909323973 PUSHI 5 STORE IFZ 24 IFZ 20 ADD PUSHI 13 STORE NOOP POP PUSHI 895499513 NOOP PUSHI 11 LOAD PUSHI 5 STORE IFZ 13 NOOP PUSHI 8 LOAD PUSHI 0 IFZ 15 HALT STORE POP ADD IFZ 11 ADD HALT LOAD HALT NOOP HALT STORE ADD NOR STORE PUSHI 0 IFZ 3 STORE IFZ 25 HALT NOOP PUSHI 13 STORE IFZ 14 ADD NOOP PUSHI 3 LOAD NOR ADD PUSHI 3 LOAD PUSHI 3 STORE NOR NOOP POP IFZ 7 PUSHI 2 LOAD ADD PUSHI 8 STORE POP PUSHI 12 LOAD ADD POP PUSHI 2 LOAD NOOP NOOP PUSHI 6 STORE NOOP PUSHI 1912752084 IFZ 7 PUSHI 7 LOAD PUSHI 1235035345 POP PUSHI 6 STORE PUSHI 1 LOAD PUSHI 4 STORE PUSHI 533965038 PUSHI 3 LOAD NOOP PUSHI 7 LOAD NOOP NOOP POP NOR POP NOOP NOOP NOOP PUSHI 7 LOAD PUSHI 13 STORE PUSHI 8 LOAD NOOP POP NOOP PUSHI 1