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

Uninitialized value reported by GCC >= 11 #52

Open
th-otto opened this issue Dec 26, 2024 · 1 comment
Open

Uninitialized value reported by GCC >= 11 #52

th-otto opened this issue Dec 26, 2024 · 1 comment

Comments

@th-otto
Copy link

th-otto commented Dec 26, 2024

Add

handles = *(long *)handle_table / sizeof(Virtual *) - 2;
gcc reports an uninitialized value. The code looks rather strange to me, it dereference the memory just allocated. Shouldn't that just be

handles = 64;

ie. the number of new handles just allocated?

@th-otto
Copy link
Author

th-otto commented Dec 26, 2024

for (; hnd < handles; hnd++)

also looks wrong to me. At that time, hnd is (atleast) HANDLES (32), and used to access the extra table. But this must be accessed by starting at 0 again.

Even worse,

*handle_entry = &handle[hnd];
returns an entry from the original table, not from the extra table.

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

1 participant