Skip to content

Commit 953e0f2

Browse files
Pavel KosovThomas Preud'homme
authored andcommitted
Fixed relative address in LNT profile control-flow graph.
It seems the relative address in AArch64 disassembly is dec, not hex. Reviewed By: tnfchris Differential Revision: https://reviews.llvm.org/D110141
1 parent 3cb5121 commit 953e0f2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lnt/server/ui/static/lnt_profile.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,13 @@ CFG.prototype = {
137137
convertToAddress: function (addressString, addressCurrent) {
138138
// If the address starts with '#' it is a relative one
139139
// 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);
142145
else
143-
return parseInt(addressString, 16);
146+
return parseInt(addressString, base);
144147
},
145148

146149
parseDisassembly: function(counter) {

0 commit comments

Comments
 (0)