Fix reused integers from being optimized out#14
Conversation
Signed-off-by: Jan200101 <sentrycraft123@gmail.com>
|
The problem was with how gcc optimized the program This being the code that triggers this sigsegv Lines 126 to 131 in 95b1fd1 if we look at prplnt Line 58 in 95b1fd1 we can tell something went horribly wrong in that gdb backtrace since j is far larger than prplnt |
|
Thanks for clarifying the change @Jan200101. @devshane Do you have a moment to review this patch? It would be great to add this here in the upstream project instead of maintaining a downstream patch only available in the Fedora package. |
|
Thanks for the fix! |
stop reused integers from being optimized out (devshane#14)
Summary
Fix segfault when reused integers are optimized out by compiler
Background
This patch was contributed by @Jan200101 to fix a reported segfault in the Fedora package from compiler optimizations. We can carry a custom patch for the Fedora-specific package, but we generally try to work with an upstream so everyone may benefit from a change, not only Fedora.
This change was tested with a local scratch build on at least two Fedora machines. It is likely other distributions could face similar issues when upgrading their compilers.
Details
It is a simple change, and honestly I am not a C developer. If you really want an explanation, @Jan200101 could probably provide one if you ask.
If this change is accepted, it would be helpful to cut a new release with a git tag. This will trigger the first step in the Fedora package distribution process for shipping an update. 🙂
Outcome
Support optimizations from newer versions of compilers without segfaulting after opening the mailbox