Menu

#403 If used in a string expression, index vectors seem to not work correctly

v1.1.x
fixed
critical (96)
v1.1.1
Bug Fix
2019-01-27
2018-11-21
Erik Hänel
No

If one uses index vectors in a string expression, it seems that it is not possible any more:

print results(#,cmp(results(1,:), max(results(1,:)), 0)) + " gewinnt!"

This doesn't work currently.

Analysis:

The issue is the usage of the max() function, which has been overloaded for strings. In the argument parsing function parser_StringFuncArgParser(..., bool& bLogicalOnly) (there are multiple of this function, but only one with the bool& at the end) the boolean flag bLogicalOnly is not set for the case that there are no strings in the argument. Add bLogicalOnly = true; directly before the final return sArg.size(); statement (around the line 2561). Use the file from ticket [#402] for testing.

Implementation:

  • Implementation: The fix was processed as indicated by the analysis.
  • Revision: [r451]
  • Implementation test: Skript maexle ran without deviation

Documentation:

  • ChangesLog: updated
  • Comments: The changed section were commented
  • Documentation articles: Not needed
  • Language files: Not needed

Tests:

The fix was added to the automatic tests. No deviations detected. Bug fix implemented successfully.

Related

Commit: [r451]
Tickets: #402

Discussion

  • Erik Hänel

    Erik Hänel - 2018-11-21
    • status: open --> accepted
     
  • Erik Hänel

    Erik Hänel - 2018-11-23
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -3,3 +3,20 @@
         print results(#,cmp(results(1,:), max(results(1,:)), 0)) + " gewinnt!"
    
     This doesn't work currently.
    +
    +###Analysis:
    +(*Describe, what's the issue and which changes have to be made*)
    +
    +###Implementation:
    +* Implementation: (*Describe, what you've changed*) 
    +* Revision: [rXXX]
    +* Implementation test: (*Describe the type of test, which you performed, and if it was successful*)
    +
    +###Documentation:
    +* ChangesLog: (*Have you updated the changes log?*)
    +* Comments: (*Have you written comments in the code, which describe your change?*)
    +* Documentation articles: (*Have you updated the documentation articles?*)
    +* Language files: (*Have you updated the language files?*)
    +
    +###Tests:
    +(*Describe, which tests you performed and their outcome*)
    
    • status: accepted --> analyzing
     
  • Erik Hänel

    Erik Hänel - 2018-11-24
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -5,7 +5,7 @@
     This doesn't work currently.
    
     ###Analysis:
    -(*Describe, what's the issue and which changes have to be made*)
    +The issue is the usage of the `max()` function, which has been overloaded for strings. In the argument parsing function `parser_StringFuncArgParser(..., bool& bLogicalOnly)` (there are multiple of this function, but only one with the `bool&` at the end) the boolean flag `bLogicalOnly` is not set for the case that there are no strings in the argument. Add `bLogicalOnly = true;` directly before the final `return sArg.size();` statement (around  the line 2561). Use the file from ticket #402 for testing.
    
     ###Implementation:
    
     * Implementation: (*Describe, what you've changed*) 
    
    • status: analyzing --> implementing
    • assigned_to: Erik Hänel --> Jonas Jansen
     
  • Erik Hänel

    Erik Hänel - 2018-11-24
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -5,7 +5,7 @@
     This doesn't work currently.
    
     ###Analysis:
    -The issue is the usage of the `max()` function, which has been overloaded for strings. In the argument parsing function `parser_StringFuncArgParser(..., bool& bLogicalOnly)` (there are multiple of this function, but only one with the `bool&` at the end) the boolean flag `bLogicalOnly` is not set for the case that there are no strings in the argument. Add `bLogicalOnly = true;` directly before the final `return sArg.size();` statement (around  the line 2561). Use the file from ticket #402 for testing.
    +The issue is the usage of the `max()` function, which has been overloaded for strings. In the argument parsing function `parser_StringFuncArgParser(..., bool& bLogicalOnly)` (there are multiple of this function, but only one with the `bool&` at the end) the boolean flag `bLogicalOnly` is not set for the case that there are no strings in the argument. Add `bLogicalOnly = true;` directly before the final `return sArg.size();` statement (around  the line 2561). Use the file from ticket [#402] for testing.
    
     ###Implementation:
    
     * Implementation: (*Describe, what you've changed*) 
    
     

    Related

    Tickets: #402

  • Jonas Jansen

    Jonas Jansen - 2019-01-24
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -8,15 +8,15 @@
     The issue is the usage of the `max()` function, which has been overloaded for strings. In the argument parsing function `parser_StringFuncArgParser(..., bool& bLogicalOnly)` (there are multiple of this function, but only one with the `bool&` at the end) the boolean flag `bLogicalOnly` is not set for the case that there are no strings in the argument. Add `bLogicalOnly = true;` directly before the final `return sArg.size();` statement (around  the line 2561). Use the file from ticket [#402] for testing.
    
     ###Implementation:
    -* Implementation: (*Describe, what you've changed*) 
    -* Revision: [rXXX]
    -* Implementation test: (*Describe the type of test, which you performed, and if it was successful*)
    +* Implementation:  The fix was processed as indicated by the analysis.
    +* Revision: [r451]
    +* Implementation test: Skript maexle ran without deviation
    
     ###Documentation:
    -* ChangesLog: (*Have you updated the changes log?*)
    -* Comments: (*Have you written comments in the code, which describe your change?*)
    -* Documentation articles: (*Have you updated the documentation articles?*)
    -* Language files: (*Have you updated the language files?*)
    +* ChangesLog: updated
    +* Comments: The changed section were commented
    +* Documentation articles: Not needed
    +* Language files: Not needed
    
     ###Tests:
     (*Describe, which tests you performed and their outcome*)
    
    • status: implementing --> testing
    • assigned_to: Jonas Jansen --> Erik Hänel
     

    Related

    Commit: [r451]
    Tickets: #402

  • Erik Hänel

    Erik Hänel - 2019-01-27
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -19,4 +19,4 @@
    
     * Language files: Not needed
    
     ###Tests:
    -(*Describe, which tests you performed and their outcome*)
    +The fix was added to the automatic tests. No deviations detected. Bug fix implemented successfully.
    
    • status: testing --> fixed
     

Anonymous
Anonymous

Add attachments
Cancel