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

FEMTree: Fix infinite loop due to 32-bit integer overflow. #269

Closed
wants to merge 1 commit into from

Conversation

nh2
Copy link

@nh2 nh2 commented Aug 5, 2023

The code

size_t sz = nodeCount();
for( unsigned int i=0 ; i<sz ; i++ ) nodeHasData[i] = 0;

looped forever when nodeCount() is >= 2^32.

The code

    size_t sz = nodeCount();
    for( unsigned int i=0 ; i<sz ; i++ ) nodeHasData[i] = 0;

looped forever when `nodeCount()` is >= 2^32.
@mkazhdan
Copy link
Owner

mkazhdan commented Aug 6, 2023

Thanks. I have modified the code and updated the repo.
Independently, did you enable the BIG_DATA macro in PreProcessor.h?

@nh2
Copy link
Author

nh2 commented Aug 7, 2023

Thanks. I have modified the code and updated the repo.

Great, thanks!

I've also posted

to help find such issues.

Independently, did you enable the BIG_DATA macro in PreProcessor.h?

Yes, but not in PreProcessor.hs, instead I'm currently passing it as a CFLAGS=-DBIG_DATA environment variable to make.

The project would really benefit from a proper build system such as Meson or CMake, vs. commenting in and out code and Makefile lines.

@nh2 nh2 closed this Aug 7, 2023
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.

None yet

2 participants