ck_pr: fix ptr output operand widths on x86 and x86_64 #175
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Operations on a variable of type "ptr" specify that the output operand
can be a memory address. Most such operations specify that the output
operand is of type char, so it has width 1. Convert these to uint64_t
on x86_64 and uint32_t on x86.
No functional change intended. With clang 12.0.1 there is no difference
in the generated code before and after this change.
The compiler needs to know the true width of the destination operand in
some cases. In particular, when compiling with LLVM's MemorySanitizer
enabled, the generated code updates shadow state to mark variables as
initialized (or not) at byte granularity. When instrumenting inline
assembly, the compiler uses the width of the output operand(s) to figure
out how many bytes of shadow state to update. When the output operand
is cast to char, the runtime would only update one byte of shadow state
even though the store modified eight bytes of memory. This led to false
positives when enabling MSAN in the FreeBSD kernel.