Skip to content

Commit

Permalink
tcl/memory: fix syntax errors
Browse files Browse the repository at this point in the history
Using a command in an expression requires a bracketed command
substitution.

These syntax errors were caught by tclint v0.2.5
(https://github.com/nmoroze/tclint):

```
tclint tcl/memory.tcl | grep "syntax error"
```

Change-Id: I510d46222f4fb02d6ef73121b231d5b2df77e5c0
Signed-off-by: Noah Moroze <noahmoroze@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8279
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
  • Loading branch information
nmoroze authored and borneoa committed Jun 8, 2024
1 parent c7c4d4d commit eecba41
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tcl/memory.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ proc iswithin { ADDRESS BASE LEN } {
proc address_info { ADDRESS } {

foreach WHERE { FLASH RAM MMREGS XMEM UNKNOWN } {
if { info exists $WHERE } {
if { [info exists $WHERE] } {
set lmt [set N_[set WHERE]]
for { set region 0 } { $region < $lmt } { incr region } {
if { iswithin $ADDRESS $WHERE($region,BASE) $WHERE($region,LEN) } {
if { [iswithin $ADDRESS $WHERE($region,BASE) $WHERE($region,LEN)] } {
return "$WHERE $region";
}
}
Expand Down

0 comments on commit eecba41

Please sign in to comment.