We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Example: shape = par_shapes_create_torus(40, 40, 0.8);
While the crash itself happens deep inside the code (a triangle with a uninitialized value) the problem is caused around par_shapes.h#L1678 :
for (int p = 0; p < mesh->npoints; p++, src += 3) { if (weldmap[p] == p) { *dst++ = src[0]; *dst++ = src[1]; *dst++ = src[2]; *cmap++ = ci++; } else { // NOTE(phed) // Example: p == 556, weldmap[p] == 563 // condensed_map[weldmap[p]] == uninitialized // assert(weldmap[p] < p); // Seems to reliably detect when the error is about to happen *cmap++ = condensed_map[weldmap[p]]; }
A non-fix, but code that seemingly works, I am not sure how to do it in a single pass, so I resorted to a magic number to work around it:
for (int p = 0; p < mesh->npoints; p++, src += 3) { if (weldmap[p] == p) { *dst++ = src[0]; *dst++ = src[1]; *dst++ = src[2]; *cmap++ = ci++; } else { *cmap++ = 65535; } } cmap = condensed_map; for (int p = 0; p < mesh->npoints; p++) { if (*cmap == 65535) { *cmap = condensed_map[weldmap[p]]; } cmap++; }
The text was updated successfully, but these errors were encountered:
@phed I am not getting a crash for par_shapes_create_torus(40, 40, 0.8); perhaps you compiled with ffast-math?
ffast-math
Sorry, something went wrong.
Unable to repro. A more correct assert would be:
assert(weldmap[p] < mesh->npoints)
No branches or pull requests
Example:
shape = par_shapes_create_torus(40, 40, 0.8);
While the crash itself happens deep inside the code (a triangle with a uninitialized value) the problem is caused around par_shapes.h#L1678 :
A non-fix, but code that seemingly works, I am not sure how to do it in a single pass, so I resorted to a magic number to work around it:
The text was updated successfully, but these errors were encountered: