bupticybee / TexasSolver

🚀 A very efficient Texas Holdem GTO solver :spades::hearts::clubs::diamonds:
https://bupticybee.github.io/texassolver_page
GNU Affero General Public License v3.0
1.69k stars 301 forks source link

Fix UB leading to segfault in memory estimator #63

Closed moreheadm closed 2 years ago

moreheadm commented 2 years ago

The memory estimation feature was segfaulting when the program was compiled with GCC and optimizations because the re_estimate_tree_memory function didn't have a return value in some cases, which is undefined behavior. (GCC optimizes out the check for the chance node and just assumes any non-action node is a chance node). This fixes that.

bupticybee commented 2 years ago

Thank you so much for your contribution. I will test it on my device before mergeing it.