Skip to content

Instantly share code, notes, and snippets.

@MasterDuke17
Created October 24, 2017 22:19
Show Gist options
  • Save MasterDuke17/1f46cd7f02cd191ba5657731246ca4c5 to your computer and use it in GitHub Desktop.
Save MasterDuke17/1f46cd7f02cd191ba5657731246ca4c5 to your computer and use it in GitHub Desktop.
diff --git a/src/math/bigintops.c b/src/math/bigintops.c
index ed6eef76a..8a63718f9 100644
--- a/src/math/bigintops.c
+++ b/src/math/bigintops.c
@@ -554,6 +554,10 @@ MVMObject *MVM_bigint_div(MVMThreadContext *tc, MVMObject *result_type, MVMObjec
int mp_result;
+ if (!MVM_BIGINT_IS_BIG(bb) && bb->u.smallint.value == 1) {
+ return a;
+ }
+
MVMROOT(tc, a, {
MVMROOT(tc, b, {
result = MVM_repr_alloc_init(tc, result_type);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment