Byteman
  1. Byteman
  2. BYTEMAN-198

Local var reference in rule body can cause Null Pointer Exception during trigger injection if local var stack includes longs/doubles

    Details

    • Similar Issues:
      Show 10 results 

      Description

      If a ruel refers to a local variable in scope at the trigger location then the injected trigger code needs to load it and pass it as a parameter to the code in the rule body. The computation of the relevant local var slot appears to go wrong if any of the preceding local variables are longs or doubles. It seems that the calculation is only allowing for one slot when these values actually employ two slots.

        Activity

        Hide
        Andrew Dinn
        added a comment -

        The problem is in the visitFrame method which analyses frame records in order to keep track of in-use local variable slots and their types. While it was correctly counting two slots for a double or long it was erroneously installing only one entry in the per-slot types list. So, the type lookup for the last local variable (which follows a long in the reported test case) was passing an index which dropped off the end of the types list.

        Show
        Andrew Dinn
        added a comment - The problem is in the visitFrame method which analyses frame records in order to keep track of in-use local variable slots and their types. While it was correctly counting two slots for a double or long it was erroneously installing only one entry in the per-slot types list. So, the type lookup for the last local variable (which follows a long in the reported test case) was passing an index which dropped off the end of the types list.
        Hide
        Andrew Dinn
        added a comment -

        Fixed by pushing both the type and a null into the type list whenever a long or double local is seen. this keeps the type entry indices the same as the local var indices

        Show
        Andrew Dinn
        added a comment - Fixed by pushing both the type and a null into the type list whenever a long or double local is seen. this keeps the type entry indices the same as the local var indices

          People

          • Assignee:
            Andrew Dinn
            Reporter:
            Anton Ryabtsev
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: