mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-31 22:48:21 +00:00
kernel: add ubsan bindings, fix some UB reported by it
This commit is contained in:
@@ -30,7 +30,7 @@ static int maxseek(int minor, size_t *max) {
|
||||
|
||||
static long current = 0xdeadbeefbadc0ffe;
|
||||
|
||||
static uint8_t getrand8() {
|
||||
__attribute__((no_sanitize("undefined"))) static uint8_t getrand8() {
|
||||
current += timekeeper_timefromboot().ns * timekeeper_timefromboot().s - timekeeper_time().ns * timekeeper_time().s + timekeeper_time().s;
|
||||
return current & 0xff;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user