Skip to content

Commit f97f67d

Browse files
committed
fix: size float scratch buffer from its documented bound
1 parent 0c11532 commit f97f67d

20 files changed

Lines changed: 4303 additions & 4303 deletions

‎std/assembly/util/dtoa.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { CharCode, POWERS10 } from "./string";
2-
import { DIGITS, MAX_DOUBLE_LENGTH } from "./number";
2+
import { DIGITS } from "./number";
33

44
// Fixed-point log significands shared by the dec-exp / binary-exp estimates below.
55
@lazy @inline const LOG10_2_SIGNIFICAND = 0x4D105; // ~(log10(2) * 2**20)

‎std/assembly/util/number.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ export function itoa64(value: i64, radix: i32): String {
410410

411411

412412
// @ts-ignore: decorator
413-
@lazy @inline const dtoa_buf = memory.data(128);
413+
@lazy @inline const dtoa_buf = memory.data(MAX_DOUBLE_LENGTH << 1);
414414

415415
export function dtoa<T extends number>(value: T): String {
416416
if (value == 0) return "0.0";

‎tests/compiler/issues/2873.debug.wat‎

Lines changed: 52 additions & 52 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)