diff --git a/src/common.h b/src/common.h index 94d351d5d3..c3c03e89c4 100644 --- a/src/common.h +++ b/src/common.h @@ -288,7 +288,7 @@ bitsToFloat(uint32_t bits) return f; } -inline intptr_t +inline int difference(void* a, void* b) { return reinterpret_cast(a) - reinterpret_cast(b); diff --git a/src/compile.cpp b/src/compile.cpp index 8d51a80b5c..f43f2f5623 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -5412,7 +5412,8 @@ jumpAndInvoke(MyThread* t, object method, void* base, void* stack, ...) stack, argumentCount * BytesPerWord, arguments, - t->arch->alignFrameSize(t->arch->argumentFootprint(argumentCount)) + (t->arch->alignFrameSize(t->arch->argumentFootprint(argumentCount)) + + t->arch->frameReturnAddressSize()) * BytesPerWord); } @@ -5922,11 +5923,11 @@ class MyProcessor: public Processor { t->init(); if (false) { - fprintf(stderr, "%"LD"\n", difference(&(t->continuation), t)); - fprintf(stderr, "%"LD"\n", difference(&(t->exception), t)); - fprintf(stderr, "%"LD"\n", difference(&(t->exceptionStackAdjustment), t)); - fprintf(stderr, "%"LD"\n", difference(&(t->exceptionOffset), t)); - fprintf(stderr, "%"LD"\n", difference(&(t->exceptionHandler), t)); + fprintf(stderr, "%d\n", difference(&(t->continuation), t)); + fprintf(stderr, "%d\n", difference(&(t->exception), t)); + fprintf(stderr, "%d\n", difference(&(t->exceptionStackAdjustment), t)); + fprintf(stderr, "%d\n", difference(&(t->exceptionOffset), t)); + fprintf(stderr, "%d\n", difference(&(t->exceptionHandler), t)); exit(0); }