Menu

#638 'declare' causes issues with procedure arguments

v1.1.x
fixed
v1.1.3
Bug Fix
2022-01-18
2021-08-31
Erik Hänel
No

If used in combination like this, declare causes strange argument parsing issues:

declare myvar := "C:/mypath"

var path
path = myvar + "/mysubpath/myfile.ext";
$myproc(path);

Analysis:

The actual issue was that the user had used the same names for the arguments as the constants in declare. We will enhance the checks of the arguments and provide static code analyzer errors.

Implementation:

  • Implementation: Implemented as proposed by the analysis.
  • Revision: [r1011]
  • Implementation test: Procedures with overwritten arguments were executed and the corresponding error was thrown. Furthermore, the static code analyzer will now also display an error in this case.

Documentation:

  • ChangesLog updated
  • Code changes commented
  • Documentation articles:
    • corresponding documentation articles updated
    • new documentation articles created
    • not needed
  • Language files:
    • corresponding language files updated
    • not needed

Tests:

This fix was tested manually. No deviations detected.

Related

Commit: [r1011]

Discussion

  • Erik Hänel

    Erik Hänel - 2021-08-31
    • labels: --> cmd, internal, procedure
    • status: open --> accepted
     
  • Erik Hänel

    Erik Hänel - 2021-08-31
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -5,3 +5,25 @@
         var path
         path = myvar + "/mysubpath/myfile.ext";
         $myproc(path);
    +    
    +###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 updated
    +* [ ] Code changes commented
    +* **Documentation articles:**
    +    * [ ] corresponding documentation articles updated
    +    * [ ] new documentation articles created
    +    * [ ] not needed
    +* **Language files:**
    +    * [ ] corresponding language files updated
    +    * [ ] not needed
    +
    +###Tests:
    +(*Describe, which tests you performed and their outcome*)
    
    • status: accepted --> analyzing
     
  • Erik Hänel

    Erik Hänel - 2021-09-12
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -7,7 +7,7 @@
         $myproc(path);
    
     ###Analysis:
    -(*Describe, what's the issue and which changes have to be made*)
    +The actual issue was that the user had used the same names for the arguments as the constants in `declare`. We will enhance the checks of the arguments and provide static code analyzer errors.
    
     ###Implementation:
     * Implementation: (*Describe, what you've changed*) 
    
    • status: analyzing --> implementing
     
  • Erik Hänel

    Erik Hänel - 2021-09-13
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -10,19 +10,19 @@
     The actual issue was that the user had used the same names for the arguments as the constants in `declare`. We will enhance the checks of the arguments and provide static code analyzer errors.
    
     ###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: Implemented as proposed by the analysis.
    +* Revision: [r1011]
    +* Implementation test: Procedures with overwritten arguments were executed and the corresponding error was thrown. Furthermore, the static code analyzer will now also display an error in this case.
    
     ###Documentation:
    -* [ ] ChangesLog updated
    -* [ ] Code changes commented
    +* [x] ChangesLog updated
    +* [x] Code changes commented
     * **Documentation articles:**
         * [ ] corresponding documentation articles updated
         * [ ] new documentation articles created
    -    * [ ] not needed
    +    * [x] not needed
     * **Language files:**
    -    * [ ] corresponding language files updated
    +    * [x] corresponding language files updated
         * [ ] not needed
    
     ###Tests:
    
    • status: implementing --> testing
     

    Related

    Commit: [r1011]

  • Erik Hänel

    Erik Hänel - 2022-01-18
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -26,4 +26,4 @@
         * [ ] not needed
    
     ###Tests:
    -(*Describe, which tests you performed and their outcome*)
    +This fix was tested manually. No deviations detected.
    
    • status: testing --> fixed
     

Anonymous
Anonymous

Add attachments
Cancel