Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Incorrect usage of & instead of &&? #37

Open
asmblur opened this issue Dec 30, 2020 · 4 comments
Open

Incorrect usage of & instead of &&? #37

asmblur opened this issue Dec 30, 2020 · 4 comments

Comments

@asmblur
Copy link

asmblur commented Dec 30, 2020

if ((refType.isJump() || refType.isCall()) & refType.isComputed()) {

Is this an accidental usage of & instead of &&?

@astrelsky
Copy link
Contributor

if ((refType.isJump() || refType.isCall()) & refType.isComputed()) {

Is this an accidental usage of & instead of &&?

This is a good question. The analyzer is a copy of the MipsAddressAnalyzer in Ghidra with the necessary changes for this plugin.

@emteere if you have a moment may you confirm whether this is correct or not? This is the same as line 388 in MipsAddressAnalyzer.java

@beardypig
Copy link
Owner

I haven't looked at the return types, but if they are all Boolean then it won't make a difference will it?

@astrelsky
Copy link
Contributor

I haven't looked at the return types, but if they are all Boolean then it won't make a difference will it?

I was thinking about that. It wouldn't matter in c. I'm assuming it wouldn't either in java.

@asmblur
Copy link
Author

asmblur commented Mar 20, 2021

Technically it should work since "true" is 1 and "false" is 0, so ("true" & "true") == "true". I was just pointing out the bug.

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

No branches or pull requests

3 participants