Commits

Armin Rigo committed 6db8370

Fix?

  • Participants
  • Parent commits ad626a2
  • Branches stmgc-c4

Comments (0)

Files changed (1)

File rpython/translator/stm/writebarrier.py

         def get_category_or_null(v):
             # 'v' is an original variable here, or a constant
             if isinstance(v, Constant) and not v.value:    # a NULL constant
-                return None
+                return 'Z'
             if v in renamings:
                 return renamings[v].category
             if isinstance(v, Constant):
             if op in self.expand_comparison:
                 cats = (get_category_or_null(op.args[0]),
                         get_category_or_null(op.args[1]))
-                if None not in cats and (cats[0] < 'V' or cats[1] < 'V'):
+                if 'Z' not in cats and (cats[0] < 'V' or cats[1] < 'V'):
                     if newop.opname == 'ptr_ne':
                         v = varoftype(lltype.Bool)
                         negop = SpaceOperation('bool_not', [v],
            * 'R': the read barrier was applied
            * 'V': same as W, except needs a repeat_write_barrier
            * 'W': the write barrier was applied
+           * 'Z': the null constant
 
        The letters are chosen so that a barrier is needed to change a
        pointer from category x to category y if and only if y > x.