URL:
  <http://gna.org/bugs/?22272>

                 Summary: Last (16th) user flag overlaps with role range (=>
assertion failure)
                 Project: Freeciv
            Submitted by: jtn
            Submitted on: Sat 05 Jul 2014 11:53:20 BST
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
                  Status: In Progress
             Assigned to: jtn
        Originator Email: 
             Open/Closed: Open
                 Release: 
         Discussion Lock: Any
        Operating System: Any
         Planned Release: 2.5.0, 2.6.0

    _______________________________________________________

Details:

Reported by GriffonSpade on the forum
<http://forum.freeciv.org/f/viewtopic.php?f=8&t=319>:

Since unit flags and roles were unified in a single contiguous enum, we've
had:


#define L_FIRST UTYF_LAST_USER_FLAG


Results:
* 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:

  <http://gna.org/bugs/?22272>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to