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

[libc] Add stack-checking alloca for GCC/IA16 #2124

Merged
merged 1 commit into from
Dec 6, 2024
Merged

[libc] Add stack-checking alloca for GCC/IA16 #2124

merged 1 commit into from
Dec 6, 2024

Conversation

ghaerr
Copy link
Owner

@ghaerr ghaerr commented Dec 6, 2024

Adds stack-overflow checking alloca to GCC/IA16 for ELKS. This allows alloca to be safely used in ia16-elf-gcc projects without fear of stack overflow. Some tools in 8086-toolchain will be updated after this is committed.

This version of alloca will check for protected stack remaining for the allocation, and if there isn't enough, the message "ALLOCA FAIL, INCREASE STACK" will be displayed, and alloca will return NULL.

Similar to #2123.

Next steps will be to provide standard stack overflow checking in every function call as well as malloc, for both GCC/IA16 and OWC. This will help developers writing more complex programs, such as those in 8086-toolchain, to know when the stack or heap areas are too small, instead of the application just crashing.

@ghaerr ghaerr merged commit 156dbc5 into master Dec 6, 2024
2 checks passed
@ghaerr ghaerr deleted the ia16 branch December 6, 2024 04:21
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.

1 participant