Notes
This function is in beta test. Please help improve it in the issues
here.
/in/lab5.c:178:29: runtime error: index -2 out of bounds for type 'double [120]' ================================================================= ==4780==ERROR: AddressSanitizer: global-buffer-overflow on address 0x564d8dd67690 at pc 0x564d8db5cc0c bp 0x7ffdb80c8040 sp 0x7ffdb80c8030 READ of size 8 at 0x564d8dd67690 thread T0 #0 0x564d8db5cc0b in in2po (/out/package/lab5+0x7c0b) #1 0x564d8db5ae5e in main (/out/package/lab5+0x5e5e) #2 0x7f6cc30bac86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86) #3 0x564d8db5afc9 in _start (/out/package/lab5+0x5fc9) 0x564d8dd67690 is located 16 bytes to the left of global variable 'stack' defined in '/in/lab5.c:6:8' (0x564d8dd676a0) of size 960 0x564d8dd67690 is located 44 bytes to the right of global variable 'top' defined in '/in/lab5.c:7:5' (0x564d8dd67660) of size 4 SUMMARY: AddressSanitizer: global-buffer-overflow (/out/package/lab5+0x7c0b) in in2po Shadow bytes around the buggy address: 0x0aca31ba4e80: 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
JOJ Answer
2.000000 0.000250 -0.250000 0.888889 -3.777800 777.375000 64.000000 4.160000 2.550000 128.000000