Use proper PC.
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
void ThrowNullPointerException() {
|
void ThrowNullPointerException() {
|
||||||
void* pc = __builtin_return_address(1);
|
void* pc = __builtin_return_address(0);
|
||||||
char message[100];
|
char message[100];
|
||||||
snprintf(message, sizeof(message), "NullPointerException at %p", pc);
|
snprintf(message, sizeof(message), "NullPointerException at %p", pc);
|
||||||
fprintf(stderr, "%s\n", message);
|
fprintf(stderr, "%s\n", message);
|
||||||
@@ -16,7 +16,7 @@ void ThrowNullPointerException() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ThrowArrayIndexOutOfBoundsException() {
|
void ThrowArrayIndexOutOfBoundsException() {
|
||||||
void* pc = __builtin_return_address(1);
|
void* pc = __builtin_return_address(0);
|
||||||
char message[100];
|
char message[100];
|
||||||
snprintf(message, sizeof(message), "ArrayIndexOutOfBoundsException at %p", pc);
|
snprintf(message, sizeof(message), "ArrayIndexOutOfBoundsException at %p", pc);
|
||||||
fprintf(stderr, "%s\n", message);
|
fprintf(stderr, "%s\n", message);
|
||||||
|
|||||||
Reference in New Issue
Block a user