Skip to content

Fixes PPC tbegin printing #1478

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

Closed
wants to merge 4 commits into from

Conversation

catenacyber
Copy link
Contributor

Found by oss-fuzz
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14642

Might be related to #1470

Checked against onlinedisassembler.com

@aquynh
Copy link
Collaborator

aquynh commented May 13, 2019

for the record, please provide the input triggering this bug too.

to fix this kind of bug, it is really tricky to fix the autogen files like this .inc file, because it can break something else.

we better fix the original code, probably in https://github.com/aquynh/capstone/blob/next/suite/synctools/tablegen/PPC/PPCInstrHTM.td#L30-L31, then run the synctools under https://github.com/aquynh/capstone/blob/next/suite/synctools/ again to generate .inc files.

@catenacyber
Copy link
Contributor Author

The input is :
cstool -d ppc64be "7c 20 05 1d"
It is available but only to you for now at the supplied link.

I will try to take a look at this td file

@aquynh
Copy link
Collaborator

aquynh commented May 13, 2019 via email

@catenacyber
Copy link
Contributor Author

Here is a try.
Can you generate the inc files ?

@aquynh
Copy link
Collaborator

aquynh commented May 14, 2019

this looks nice! can you send this fix to LLVM, and to see what they say?

@aquynh
Copy link
Collaborator

aquynh commented May 14, 2019

will you also fix TD files for #1470?

@catenacyber
Copy link
Contributor Author

See https://reviews.llvm.org/D61935 for LLVM
I will wait for it before tackling #1470 that should be similar

aquynh added a commit that referenced this pull request May 16, 2019
@aquynh
Copy link
Collaborator

aquynh commented May 16, 2019

i picked up the modified td file, and generated new .inc files, see e9c0772

the output looks good now.

$ cstool ppc64be "7c 20 05 1d"                 
 0  7c 20 05 1d  tbegin.	1

can you now revert the change of this PR on arch/PowerPC/PPCGenAsmWriter.inc?

@catenacyber
Copy link
Contributor Author

Here you go but it looks like you already merged it :-)

@aquynh
Copy link
Collaborator

aquynh commented May 17, 2019

no i did not merge that, but generated the change from your fix on .td file. you can see some difference: e9c0772

on this fix for .td file, let me know when you get feedback from LLVM.

@catenacyber
Copy link
Contributor Author

@aquynh I think that the modified file PPCInstrHTM.td here https://reviews.llvm.org/D61935#change-55VNPVmjSoAu is now good enough for capstone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants