forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
putting 0x22 into an unsigned char array is causing me a problem
compiling this with -S
static unsigned char works[] = {0x01, 0x02, 0x03};
static unsigned char fails[] = {0x21, 0x22, 0x23};
volatile unsigned char *o = (volatile unsigned char *)0;
int main(int argc, char *argv[])
{
for (int i = 0; i < 3; i++)
{
*o = works[i];
*o = fails[i];
}
}
gives:
section .data,"aw",@progbits
private _works
_works:
db "���"
section .data,"aw",@progbits
private _fails
_fails:
db "!""#"
Which I think might be malformed.
Using the x64 version of clang gives something more like I would expect, but I'm not sure if the output is what you expect and there is an issue elsewhere?
works: # @works
.ascii "\001\002\003"
fails: # @fails
.ascii "!\"#"
Metadata
Metadata
Assignees
Labels
No labels