File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -137,10 +137,13 @@ CFG.prototype = {
137
137
convertToAddress : function ( addressString , addressCurrent ) {
138
138
// If the address starts with '#' it is a relative one
139
139
// and should be processed differently
140
- if ( addressString . startsWith ( '#' ) )
141
- return addressCurrent + parseInt ( addressString . substring ( 1 ) , 16 ) ;
140
+ var isRelative = addressString . startsWith ( '#' ) ;
141
+ var charOffset = ( isRelative ? 1 : 0 ) ;
142
+ var base = ( addressString . substring ( charOffset ) . startsWith ( '0x' ) ? 16 : 10 ) ;
143
+ if ( isRelative )
144
+ return addressCurrent + parseInt ( addressString . substring ( 1 ) , base ) ;
142
145
else
143
- return parseInt ( addressString , 16 ) ;
146
+ return parseInt ( addressString , base ) ;
144
147
} ,
145
148
146
149
parseDisassembly : function ( counter ) {
You can’t perform that action at this time.
0 commit comments