PlutoLang / Pluto

A superset of Lua 5.4 with a focus on general-purpose programming.
https://pluto-lang.org/docs/Introduction
MIT License
338 stars 20 forks source link

Test failure with O3 #807

Closed XmiliaH closed 2 months ago

XmiliaH commented 2 months ago

When compiling Pluto with -O3 the test assert(crypto.fnv1("hello world") == 0x7DCF62CDB1910E6F) is failing. The returned value by fnv1 is 0x8000000000000064.

This seems to be caused by the signed integer overflow at https://github.com/PlutoLang/Pluto/blob/17438aec969da70500d7817bc3a3fe15a5b77fb2/src/lcryptolib.cpp#L37 being optimized away.