shithub: riscv

Download patch

ref: 01afe9328b3ddf51c1ab2725684fc542bc81f76c
parent: 1a5c8430d20d7ec5cd52c8335af6490ab1dabcf2
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun Dec 6 15:53:54 EST 2015

libmp: fix assert() for mpexp() with nil modulus

--- a/sys/src/libmp/port/mpexp.c
+++ b/sys/src/libmp/port/mpexp.c
@@ -22,7 +22,7 @@
 	mpdigit d, bit;
 	int i, j;
 
-	assert(m->flags & MPnorm);
+	assert(m == nil || m->flags & MPnorm);
 	assert((e->flags & MPtimesafe) == 0);
 	res->flags |= b->flags & MPtimesafe;