This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug translator/20840] @defined($somethingundefined + 1) gives 1


https://sourceware.org/bugzilla/show_bug.cgi?id=20840

Josh Stone <jistone at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jistone at redhat dot com

--- Comment #1 from Josh Stone <jistone at redhat dot com> ---
Ugh.  This is probably a regression from trying to make autocast @defined work,
where it now relies on resolved types.  In const_folder::visit_defined_op:

      // If we got to an expression with a known type, call it defined.
      if (e->operand->type != pe_unknown)
        value = 1;
      collapse_this = true;

But in your case this is proven too optimistic.  I think we do resolve the type
of the addition binop based on knowing the right-hand side, so that can try to
propagate the type to the left.

Maybe that binop type resolution can be more conservative?  That is, still try
the type propagation from one side to the other, but leave the expression as a
whole unresolved until both sides are resolved.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]