Summary: Last (16th) user flag overlaps with role range (=>
Submitted by: jtn
Submitted on: Sat 05 Jul 2014 11:53:20 BST
Severity: 3 - Normal
Priority: 5 - Normal
Status: In Progress
Assigned to: jtn
Discussion Lock: Any
Operating System: Any
Planned Release: 2.5.0, 2.6.0
Reported by GriffonSpade on the forum
Since unit flags and roles were unified in a single contiguous enum, we've
#define L_FIRST UTYF_LAST_USER_FLAG
* role_unit_precalcs overwrites the n_with_role entry for the last user flag
with one for the (unused) 'first' role. This causes an assertion failure "in
precalc_one() [unittype.c::794]: assertion 'j == n_with_role[i]' failed" (and
a memory leak, and incorrect cached data).
* The number of roles is effectively limited to 63, not L_MAX==64 (because the
first bit in the bitfield is L_FIRST which is unused) -- not that we were in
any danger of getting near that.
Reply to this item at:
Message sent via/by Gna!
Freeciv-dev mailing list