-
-
Notifications
You must be signed in to change notification settings - Fork 989
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CMPLOG llvm pass: use CreateIntCast to cast to the right integer type #746
Conversation
are you using afl-clang-lto? |
lol. apparently afl++ dev speed is too fast for me. yes I am using clang LTO. yes it seems fixed in current dev. But I am wondering whether I would loose instrumentation of some compare instructions with the current workaround in dev?
Does this part still apply? |
I like your solution better than mine, in LTO I just skip this crashing bitcast. can you rework your PR to fit to the changed dev state? |
sure. I'll rebase and revert your workaround (edit: |
ec2b2f6
to
9b8f107
Compare
yes: |
9b8f107
to
6caec21
Compare
@vanhauser-thc done. rebased and reverted workaround. |
thank you! |
In the current dev branch I get errors while compiling a target with cmplog (afl-clang-lto++). My target uses bigints, which leads to trouble for the cmplog instrumentation. This PR fixes the issues (at least for me). Currently I get the following error:
I think bitcast
i80
toi128
doesn't work since bitcast only works with types of the exact same bit size. So we need to usezext
instead to extend toi128
in the case above. I believe thatCreateIntCast
on theIRBuilder
is the right function for this job (except we need a bitcast to an integer type first in case we are dealing with floating point values).I think that previously 128 bit integer types were also implicitly truncated due to the use of
uint64_t val = cint->getZExtValue();
to create a new constant integer. I haven't tested this, but this should be fixed now too.