[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Bug in string.unpack
- From: cherue <cherue.lual@...>
- Date: Thu, 12 Mar 2020 18:06:50 +0100
Hello,
I found a bug in string.unpack:
```
Lua 5.3.5 Copyright (C) 1994-2018 Lua.org, PUC-Rio
> string.unpack("I4", "\255\255\255\255")
4294967295 5
> string.unpack("I8", "\255\255\255\255\255\255\255\255")
-1 9
> string.unpack("I8", "\255\255\255\255\255\255\255\127")
9223372036854775807 9
> string.unpack("I8", "\255\255\255\255\255\255\255\128")
-9151314442816847873 9
```
I tried looking for the cause but I am not fluent in C. Maybe something about lua_Integer?