Skip to content
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

BV constants over 64 bits don't seem to work #480

Open
r4dr3fr4d opened this issue Apr 2, 2024 · 4 comments
Open

BV constants over 64 bits don't seem to work #480

r4dr3fr4d opened this issue Apr 2, 2024 · 4 comments

Comments

@r4dr3fr4d
Copy link

#303/#304 don't seem to work for values over ULONG_MAX.

In [5]: c = s.bitvecvalD(72, str(0xaa00000000000000bb))

In [6]: hex(c.value)
Out[6]: '0xffffffffffffffff'

Am I doing something wrong?

@aytey
Copy link
Member

aytey commented Apr 2, 2024

I assume you're referring to over the Python API and not (e.g.,) the STP binary?

My guess (and I haven't checked): c.value is a long and we need some arbitrary length type to support returning values such as these.

Would a string work (maybe)?

@r4dr3fr4d
Copy link
Author

Yes I'm using the Python API.

@aytey
Copy link
Member

aytey commented Apr 2, 2024

Okay, so "behind the scenes", this ends-up using getBVUnsignedLongLong (which gives a c_uint64), which is the cause of the issue.

As I mentioned, would a string be okay for this?

@r4dr3fr4d
Copy link
Author

That would probably be fine - if I had been around for #303, I'd probably suggest using a byte-string instead, but either would work I imagine.

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

No branches or pull requests

2 participants