-
Notifications
You must be signed in to change notification settings - Fork 89
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
Possible stale pointer usage in extract_bvh()? #81
Comments
Correction, I'm not sure if |
Adding |
Hello, and good catch! This code was in fact correct before I decided to "rework" it. I will just revert that "simplification" I did earlier, with a comment to be very careful. I also don't think this modifies or invalidates |
Fixed in ed708a2 |
In this code
What I see happen when I debug this code (Windows 11, MSVC 17.8.8):
auto& src_node = nodes[src_id];
//src_node
points into vector dataauto& dst_node = bvh.nodes[dst_id];
//dst_node
points into vector databvh.nodes.emplace_back();
// vector data may be reallocated, invalidating bothsrc_node
anddst_node
bvh.nodes.emplace_back();
// vector data may be reallocated, invalidating bothsrc_node
anddst_node
dst_node.index.first_id()
// may read via stalesrc_node
anddst_node
pointersThe text was updated successfully, but these errors were encountered: