You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.
I believe you are getting a 4 byte write (default int, 32bits on all modern platforms) for each 1 byte bool object.
Input
mut blob = raw[true, false]
Output from GCC (with no compiler warnings enabled)
build/debug/main.c: In function ‘create_buffer_11’:
build/debug/main.c:402:17: warning: ‘_Bool’ is promoted to ‘int’ when passed through ‘...’
402 | *(output + i) = va_arg(args, bool);
| ^~~~~~
build/debug/main.c:402:17: note: (so you should pass ‘int’ not ‘_Bool’ to ‘va_arg’)
build/debug/main.c:402:17: note: if this code is reached, the program will abort
The text was updated successfully, but these errors were encountered:
lefticus
changed the title
raw buffer of bool has guaranteed UB because of va_args usage in generated code
raw buffer initialization of bool has guaranteed UB because of va_args usage in generated code
Mar 10, 2024
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I believe you are getting a 4 byte write (default
int
, 32bits on all modern platforms) for each 1 bytebool
object.Input
Output from GCC (with no compiler warnings enabled)
Output from clang:
The text was updated successfully, but these errors were encountered: