Menu

#1361 SIGNAL ON ANY doesn't trigger on NOVALUE

5.0.0
closed
Erich
None
none
1
2023-01-01
2015-11-21
Erich
No
signal on any
say this is a novalue
"error-command"
exit

any:
say "condition raised:" condition("C") condition("D")
exit

This piece of code doesn't trigger on NOVALUE; it does trigger on ERROR, though.
Is this a bug or working as it should?

Rexxref says, "if NOVALUE is raised and there is no NOVALUE trap enabled, but there is a SIGNAL ON ANY trap, the ANY trap is called for the NOVALUE condition."

Related

Bugs: #1361

Discussion

  • LesK

    LesK - 2015-11-21

    The Ref seems perfectly precise to me. Note however that not all SIGNAL ON conditions have a
    corresponding CALL ON. NOVALUE and SYNTAX, for instance.

    Which line is tripping the trap?

     
  • Erich

    Erich - 2015-11-21
    • summary: SIGNAL/CALL ON ANY doesn't trigger on NOVALUE --> SIGNAL ON ANY doesn't trigger on NOVALUE
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -9,7 +9,7 @@
     exit
     ~~~~
    
    -This piece of code doesn't trigger on NOVALUE; it *does* trigger on ERROR, though.  Same for CALL ON ANY
    +This piece of code doesn't trigger on NOVALUE; it *does* trigger on ERROR, though.
     Is this a bug or working as it should?
    
     Rexxref says, "if NOVALUE is raised and there is no NOVALUE trap enabled, but there is a SIGNAL ON ANY trap, the ANY trap is called for the NOVALUE condition."
    
     
  • Erich

    Erich - 2015-11-21

    | Note however that not all SIGNAL ON conditions have a corresponding CALL ON.
    You're right - how embarrassing. I've removed my nonsense about CALL ON ANY from the ticket

    | Which line is tripping the trap?
    Well, say this is a novalue should trigger NOVALUE, but it doesn't for me
    The following "error-command" does trigger ERROR

     
  • LesK

    LesK - 2015-11-21

    Strange! I reduced it to its simplest form and it works just fine for 32 bit 4.2.0

    signal on any
    say this is a novalue
    say "error. Novalue not tripped"
    exit

    any:
    say "condition raised:" condition("C") condition("D")
    exit

    ->> condition raised: NOVALUE THIS

     
  • Erich

    Erich - 2015-11-21

    Just tested with 4.2:
    4.2 - 64-bit: NOVALUE triggered
    5.0 - 64-bit: NOVALUE not triggered

     
  • LesK

    LesK - 2015-11-22

    So it's 5.0 that has the problem! Just 64 bit?

     
  • Erich

    Erich - 2015-11-22

    (posting again, as SF seems to be eating my posts)
    Committed fix in revision [r11004].

    Just to make sure, Rick, if you've got some time, can you please check, that this fix makes sense?

    It for sure fixes above example, but I'm wondering how the tests (which are using signal on any) can run clean both with the previous and this patched code, although this patch reverses the "ANY" path of the willTrap function ..

     

    Related

    Commit: [r11004]

    • Rick McGuire

      Rick McGuire - 2015-11-22

      On Sunday, November 22, 2015, Erich erich_st@users.sf.net wrote:

      (posting again, as SF seems to be eating my posts)
      Committed fix in revision [r11004].

      Just to make sure, Rick, if you've got some time, can you please check,
      that this fix makes sense?

      It for sure fixes above example, but I'm wondering how the tests (which
      are using signal on any) can run clean both with the previous and this
      patched code, although this patch reverses the "ANY" path of the willTrap
      function ..

      Ok, this makes more sense when viewed on my iPad rather than my phone, but
      I'm not sure I fully understand your question. I will not have access to
      the full code until I return from my trip, so I'm unable to investigate
      this much further until I return.


      [bugs:#1361] SIGNAL ON ANY doesn't trigger on NOVALUE

      Status: open
      Group: 5.0.0
      Created: Sat Nov 21, 2015 09:00 PM UTC by Erich
      Last Updated: Sun Nov 22, 2015 12:33 AM UTC
      Owner: nobody

      ~~~~
      signal on any
      say this is a novalue
      "error-command"
      exit

      any:
      say "condition raised:" condition("C") condition("D")
      exit
      ~~~~

      This piece of code doesn't trigger on NOVALUE; it does trigger on ERROR,
      though.
      Is this a bug or working as it should?

      Rexxref says, "if NOVALUE is raised and there is no NOVALUE trap enabled,
      but there is a SIGNAL ON ANY trap, the ANY trap is called for the NOVALUE
      condition."


      Sent from sourceforge.net because you indicated interest in <
      https://sourceforge.net/p/oorexx/bugs/1361/>

      To unsubscribe from further messages, please visit <
      https://sourceforge.net/auth/subscriptions/>

       

      Related

      Bugs: #1361
      Commit: [r11004]

    • Rick McGuire

      Rick McGuire - 2015-11-22

      I'm not sure what you actually changed. From the commit message it looks
      like all you did was change the indentation on one line.

      On Sunday, November 22, 2015, Erich erich_st@users.sf.net wrote:

      (posting again, as SF seems to be eating my posts)
      Committed fix in revision [r11004].

      Just to make sure, Rick, if you've got some time, can you please check,
      that this fix makes sense?

      It for sure fixes above example, but I'm wondering how the tests (which
      are using signal on any) can run clean both with the previous and this
      patched code, although this patch reverses the "ANY" path of the willTrap
      function ..


      [bugs:#1361] SIGNAL ON ANY doesn't trigger on NOVALUE

      Status: open
      Group: 5.0.0
      Created: Sat Nov 21, 2015 09:00 PM UTC by Erich
      Last Updated: Sun Nov 22, 2015 12:33 AM UTC
      Owner: nobody

      ~~~~
      signal on any
      say this is a novalue
      "error-command"
      exit

      any:
      say "condition raised:" condition("C") condition("D")
      exit
      ~~~~

      This piece of code doesn't trigger on NOVALUE; it does trigger on ERROR,
      though.
      Is this a bug or working as it should?

      Rexxref says, "if NOVALUE is raised and there is no NOVALUE trap enabled,
      but there is a SIGNAL ON ANY trap, the ANY trap is called for the NOVALUE
      condition."


      Sent from sourceforge.net because you indicated interest in <
      https://sourceforge.net/p/oorexx/bugs/1361/>

      To unsubscribe from further messages, please visit <
      https://sourceforge.net/auth/subscriptions/>

       

      Related

      Bugs: #1361
      Commit: [r11004]

      • Erich

        Erich - 2015-11-23

        it looks like all you did was change the indentation on one line.

        Rick, I've removed the "!" (not) from the return call - see below.

        If there's a specific handler (first "if" block), willTrap returns true.
        If there's an "ANY" handler (second "if" block), willTrap had returned
        "!canHandle()" which in our example case would become false for a NOVALUE
        condition. I reversed the return to "canHandle()" ("!" removed).

        snippet from RexxActivation::willTrap:

            // see if we have a handler for this condition
            TrapHandler *trapHandler = (TrapHandler
        *)settings.traps->get(condition);
        
            // if we are trapping this specifically, let the caller know.
            if (trapHandler != OREF_NULL)
            {
                return true;
            }
        
            // now try for an ANY trap
            trapHandler = (TrapHandler *)settings.traps->get(GlobalNames::ANY);
            // if we have a handler, but this can't handle this can condition,
        return false
            if (trapHandler != OREF_NULL)
            {
                return trapHandler->canHandle(condition);                // removed
        the "!" here
            }
            // no handler, return false
            return false;
        
         
  • Erich

    Erich - 2015-11-29

    Test cases added in revision [r11005].

     

    Related

    Commit: [r11005]

  • Erich

    Erich - 2017-03-14
    • status: open --> pending
    • assigned_to: Erich
     
  • Rony G. Flatscher

    • Status: pending --> closed
     

Anonymous
Anonymous

Add attachments
Cancel