GithubHelp home page GithubHelp logo

Pointer arithmetic about boolector HOT 9 CLOSED

boolector avatar boolector commented on June 23, 2024
Pointer arithmetic

from boolector.

Comments (9)

tom-kacvinsky avatar tom-kacvinsky commented on June 23, 2024

Should note that I tried changing 3UL to 3ULL (to get a 8 byte wide constant), but then crashed elsewhere.

from boolector.

arminbiere avatar arminbiere commented on June 23, 2024

from boolector.

arminbiere avatar arminbiere commented on June 23, 2024

from boolector.

tom-kacvinsky avatar tom-kacvinsky commented on June 23, 2024

OK< the proposal for how to handle this makes sense. To clarify, I was just pointing out the issue and what I did to work around it for the moment. I know what I did was not really a clean patch,

There is one other similar issues, again related to sizeof(long) and sizeof(void*):

#define leaf(l) ((void *) (1lu | (unsigned long) (l)))

I propose

#define leaf(l) ((void*)((uintptr_t)1 | (unitptr_t)(l)))

from boolector.

aniemetz avatar aniemetz commented on June 23, 2024

Well I think there is no problem here. Actually, the 'ul' (any part of it) does not seem to be necessary. It might break if 'unsigned long' as well as 'BtorNode*' are wider than 'uintptr_t' and the latter is signed. Both conditions are not satisfied (on any system I think). To make it easier to understand we could replace it with static inline BtorNode * btor_node_real_addr (const BtorNode node) { assert (sizeof (BtorNode) == sizeof (sizeof (uintptr_t)); return (BtorNode *) (~ (uintptr_t) 3 & (uintptr_t) node); }

@mpreiner and I will have a look at this and let @tom-kacvinsky know when we have a solution. @tom-kacvinsky can we ping you to test it for us?

from boolector.

mpreiner avatar mpreiner commented on June 23, 2024

@tom-kacvinsky can you try the branch https://github.com/Boolector/boolector/tree/cleanup-pointer-arith and see if this fixes your problems?

from boolector.

tom-kacvinsky avatar tom-kacvinsky commented on June 23, 2024

Will try this out today. I would have tried it this weekend but for some bizarre reason I did not get notification of the issue update until a co-worker pointed out the issue has been updated. Thanks for looking into this,

from boolector.

tom-kacvinsky avatar tom-kacvinsky commented on June 23, 2024

This worked, thank you very much.

from boolector.

mpreiner avatar mpreiner commented on June 23, 2024

This is now merged to master 66d0f7b.

from boolector.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.