From eaf4ab8091a75ee3677acb0dbc9d4d0b26a63cde Mon Sep 17 00:00:00 2001 From: hlaaftana Date: Sat, 15 Jan 2022 00:19:12 +0300 Subject: [PATCH] fix CI again --- changelog.md | 1 + lib/pure/md5.nim | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/changelog.md b/changelog.md index 52159b8658c98..393fb327db221 100644 --- a/changelog.md +++ b/changelog.md @@ -22,6 +22,7 @@ - `macros.parseExpr` and `macros.parseStmt` now accept an optional filename argument for more informative errors. - Module `colors` expanded with missing colors from the CSS color standard. +- `md5` now works at compile time and in JavaScript. ## `std/smtp` diff --git a/lib/pure/md5.nim b/lib/pure/md5.nim index ad8bc0c14d7ef..09ef7c6753cf9 100644 --- a/lib/pure/md5.nim +++ b/lib/pure/md5.nim @@ -9,7 +9,7 @@ ## Module for computing [MD5 checksums](https://en.wikipedia.org/wiki/MD5). ## -## **Note:** The procs in this module can be used at compile time. +## This module also works at compile time and in JavaScript. ## ## See also ## ======== @@ -297,9 +297,10 @@ proc writeBuffer(c: var MD5Context, index: int, memOrNot: copyMem(addr(c.buffer[index]), unsafeAddr(input[inputIndex]), len) do: - {.noSideEffect.}: - # `[]=` can sometimes track RangeDefect, even though it cannot be raised here - c.buffer[index .. index + len - 1] = input.slice(inputIndex, inputIndex + len - 1) + # cannot use system.`[]=` for arrays and openarrays as + # it can raise RangeDefect which gets tracked + for i in 0..