Skip to content

Commit ee4cd4d

Browse files
author
Fabrice Bellard
committed
compilation fix
1 parent 543897a commit ee4cd4d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

quickjs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ typedef struct JSBigInt {
379379

380380
/* this bigint structure can hold a 64 bit integer */
381381
typedef struct {
382-
JSBigInt big_int;
382+
js_limb_t big_int_buf[sizeof(JSBigInt) / sizeof(js_limb_t)]; /* for JSBigInt */
383383
/* must come just after */
384384
js_limb_t tab[(64 + JS_LIMB_BITS - 1) / JS_LIMB_BITS];
385385
} JSBigIntBuf;
@@ -10195,7 +10195,7 @@ static JSBigInt *js_bigint_new(JSContext *ctx, int len)
1019510195

1019610196
static JSBigInt *js_bigint_set_si(JSBigIntBuf *buf, js_slimb_t a)
1019710197
{
10198-
JSBigInt *r = &buf->big_int;
10198+
JSBigInt *r = (JSBigInt *)buf->big_int_buf;
1019910199
r->len = 1;
1020010200
r->tab[0] = a;
1020110201
return r;
@@ -10901,7 +10901,7 @@ static JSBigInt *js_bigint_from_float64(JSContext *ctx, int *pres, double a1)
1090110901
}
1090210902

1090310903
/* the integer is mant*2^e */
10904-
r = &buf.big_int;
10904+
r = (JSBigInt *)buf.big_int_buf;
1090510905
#if JS_LIMB_BITS == 64
1090610906
r->len = 1;
1090710907
r->tab[0] = mant;

0 commit comments

Comments
 (0)