mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-26 00:23:14 +01:00
Fix bug #356. Our sorting function was wrong if a value was between two NULL pointers.
This commit is contained in:
@@ -67,8 +67,8 @@ bool var_offset_sort_cb(const VarDeclaration* v1, const VarDeclaration* v2)
|
||||
{
|
||||
if (v1 && v2)
|
||||
return v1->offset < v2->offset;
|
||||
else
|
||||
return false;
|
||||
// sort NULL pointers towards the end
|
||||
return v1 && !v2;
|
||||
}
|
||||
|
||||
// this is pretty much the exact same thing we need to do for fields in each
|
||||
|
||||
Reference in New Issue
Block a user