Created attachment 391452 [details] [diff] [review] Patch SortedMap allows you to allocate it via plain operator new (not gc-new), but this is unsafe: it uses List<> to store values, which assume that it lies on the stack, in a GCObject, or in a GCRoot, none of which apply here. This can cause the storage to get freed prematurely, causing amusingly hard to diagnose bugs. Patch simply disallows dynamic allocation of SortedMap, requiring clients to use GCSortedMap instead.
Attachment #391452 - Flags: review?(rreitmai)
Comment on attachment 391452 [details] [diff] [review] Patch Just wondering if we should make SortedMap a GCObject and then get rid of GCSortedMap. Seems like it wouldn't add much overhead and would remove a potential source of bugs.
Attachment #391452 - Flags: review?(rreitmai) → review+
Perhaps, but there is apparently one stack-based use in nanojit that I'm not prepared to try correcting at this time.
pushed to redux as 2270:a40a2fb0fe71
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
Resolved fixed engineering / work item that has been pushed. Setting status to verified.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.