Closed guidovranken closed 10 months ago
Thank you for the report. I already know that.
It is due to too many undefined operations of signed integer operations in C++.
For example, (-1) >> 3
is undefined behavior (UB) before C++20
I want an arithmetic right shift, sar eax, 3
.
The written code to avoid UB will become dirty and slow.
I check the current code runs well on x64/M1(AArch64)/Wasm, so please wait until I find a better solution.
I could avoid UB by minimizing signed operations.
I think avoiding the UB is better.
I check the current code runs well on x64/M1(AArch64)/Wasm, so please wait until I find a better solution.
It can work well now, but suddenly break if another compiler or optimization level is used.
Okay, I'll add the UB tests to GiHub Action.
As I wrote in one previous message, the UB is not reported in the latest version.
The latest version runs sanitize=undefined on GitHub Action. https://github.com/herumi/mcl/commit/7336003cc691ba5b94fce66c272e1fc085a57116
Then compile and run the following program:
Output:
This was introduced very recently.