Notes
This function is in beta test. Please help improve it in the issues
here.
================================================================= ==27650==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60200000000c at pc 0x00000051bf2f bp 0x7ffe314cc1b0 sp 0x7ffe314cc1a8 READ of size 4 at 0x60200000000c thread T0 #0 0x51bf2e (/out/package/call_mem+0x51bf2e) #1 0x7f0ff0b1cb96 (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) #2 0x41d9e9 (/out/package/call_mem+0x41d9e9) 0x60200000000c is located 4 bytes to the left of 1-byte region [0x602000000010,0x602000000011) allocated by thread T0 here: #0 0x516010 (/out/package/call_mem+0x516010) #1 0x51b2ca (/out/package/call_mem+0x51b2ca) #2 0x7f0ff0b1cb96 (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) SUMMARY: AddressSanitizer: heap-buffer-overflow (/out/package/call_mem+0x51bf2e) Shadow bytes around the buggy address: 0x0c047fff7fb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c047fff7fc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c047fff7fd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
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
Starting tick #0
JOJ Answer
Starting tick #0