Skip to content

Instantly share code, notes, and snippets.

@timo
Created March 28, 2017 19:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timo/d528aaa26562c2afd9bb1afc6dfa06c4 to your computer and use it in GitHub Desktop.
Save timo/d528aaa26562c2afd9bb1afc6dfa06c4 to your computer and use it in GitHub Desktop.
diff --git a/src/math/bigintops.c b/src/math/bigintops.c
index b52a203..916f179 100644
--- a/src/math/bigintops.c
+++ b/src/math/bigintops.c
@@ -13,8 +13,8 @@ MVM_STATIC_INLINE void adjust_nursery(MVMThreadContext *tc, MVMP6bigintBody *bod
if (MVM_BIGINT_IS_BIG(body)) {
int used = USED(body->u.bigint);
int adjustment = MIN(used, 32768) & ~0x7;
- if (adjustment && ((tc->nursery_alloc_limit - adjustment) > tc->nursery_alloc)) {
- tc->nursery_alloc_limit -= adjustment;
+ if (adjustment && (((char *)(tc->nursery_alloc_limit) - adjustment) > tc->nursery_alloc)) {
+ tc->nursery_alloc_limit = (char *)(tc->nursery_alloc_limit) - adjustment;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment