fix a regression in int_from_bytes (#3316)

* fix a regression in int_from_bytes

* add a new test file
2 files changed