Lux-AI-Challenge / Lux-Design-S1

Home to the design and engine of the @Lux-AI-Challenge Season 1, hosted on @kaggle
https://lux-ai.org/
Apache License 2.0
897 stars 151 forks source link

Fix potential out-of-bounds memory access in cpp starter #114

Closed djkeyes closed 3 years ago

djkeyes commented 3 years ago

Hey, I noticed I introduced a bug in PR #113 . Specifically, the pointer returned by return &citytiles.back(); can become invalid if you add a bunch more citytiles to a city, and vector has to resize the underlying memory. The fix is to lookup the memory addresses after the vector is done being modified.

Let me know if there's anything you'd like me to change.

StoneT2000 commented 3 years ago

I can handle the rezipping. We usually run npm test to test, if someone wants to, we'd be very happy to have a circleci integration :)