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

Fix a potential issue where the block_find() might return NULL #265

Merged
merged 1 commit into from
Nov 16, 2023

Conversation

henrybear327
Copy link
Collaborator

As block_find might return NULL, prev->ir_tail might be dereferencing a NULL pointer.

@henrybear327
Copy link
Collaborator Author

Not sure if an assertion is actually a better idea here, as a NULL pointer would most likely be an issue in the control flow?

@jserv jserv requested a review from qwe661234 November 16, 2023 02:46
@qwe661234
Copy link
Collaborator

This situation arises when the cache is full, yet the current test cases do not produce this particular scenario.

@qwe661234 qwe661234 closed this Nov 16, 2023
@qwe661234 qwe661234 reopened this Nov 16, 2023
@jserv
Copy link
Contributor

jserv commented Nov 16, 2023

This situation arises when the cache is full, yet the current test cases do not produce this particular scenario.

Shall we extend the test cases accordingly?

@qwe661234
Copy link
Collaborator

qwe661234 commented Nov 16, 2023

This situation arises when the cache is full, yet the current test cases do not produce this particular scenario.

Shall we extend the test cases accordingly?

Actually, I encountered it in JIT mode and I has made the same modification in JIT branch. However, the block cache of interpreter would be clear if it is full, so it is difficult to produce this.

@jserv jserv merged commit 1666a41 into sysprog21:master Nov 16, 2023
26 checks passed
@henrybear327 henrybear327 deleted the fix/null_ptr_deref branch November 16, 2023 09:44
@henrybear327 henrybear327 restored the fix/null_ptr_deref branch November 16, 2023 09:44
@henrybear327 henrybear327 deleted the fix/null_ptr_deref branch November 16, 2023 09:45
@henrybear327 henrybear327 mentioned this pull request Nov 17, 2023
vestata pushed a commit to vestata/rv32emu that referenced this pull request Jan 24, 2025
Fix a potential issue where the block_find() might return NULL
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.

3 participants