summary refs log tree commit diff stats
path: root/testament
diff options
context:
space:
mode:
authorchmod222 <304922+chmod222@users.noreply.github.com>2023-04-03 05:22:31 +0200
committerGitHub <noreply@github.com>2023-04-03 05:22:31 +0200
commit31d3606fe82855dc63cb59fa509577ba1c3a3b86 (patch)
treef86f0ddfaa11f439fd85fe76074a904548b2e12b /testament
parent6ec9c7f683abd520ad70b7ca6fbee11312b5cf11 (diff)
downloadNim-31d3606fe82855dc63cb59fa509577ba1c3a3b86.tar.gz
fixes #21564; std/bitops: Add explicit type masking for the JS target (#21598)
* std/bitops: Add explicit type masking for the JS target

Typecasts on the JavaScript backend do not function the same way as they
do on C and C++ backends, so for bitwise operations we may need to mask them
back down into their allowed range when they get shifted outside it.

Since they do work as expected on the other backends, a default bitmask
of all 1's is casted down into the target type as an easily optimizable
"& 0xFF" operation for these backends.

* Fixup: this should still be a func

* Run test case on js target

* Adapt testcase to contributor guide and best practices

* Simplify constrain logic and turn into actual no-op for the C side
Diffstat (limited to 'testament')
0 files changed, 0 insertions, 0 deletions
class='alt'>
7
8
9
10
11
12
13
14
15
16
17
18
19
20