Skip to content

Commit 2afddc4

Browse files
author
Pavel Kosov
committed
[LNT] Fixed JS error caused by selecting the function with missing counters on the profile page
Some counters may be missing for some functions. These functions are labeled as `no data` on the Profile page. You will get the JS error `value.toFixed is not a function` after selecting such function and the control flow graph. This patch fixes this error. OS Laboratory. Huawei Russian Research Institute. Saint-Petersburg Reviewed By: thopre Differential Revision: https://reviews.llvm.org/D114584
1 parent 40cb83a commit 2afddc4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lnt/server/ui/static/lnt_profile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ function CFGBasicBlock (instructions, fallThruInstruction, cfg) {
2020
this.noFallThru = gjt[0];
2121
this.weight = this.instructions
2222
.reduce(function (a,b) {
23-
var weight_a = (a.weight === undefined)?a:a.weight;
24-
var weight_b = (b.weight === undefined)?b:b.weight;
23+
var weight_a = (a.weight === undefined)?0:a.weight;
24+
var weight_b = (b.weight === undefined)?0:b.weight;
2525
return weight_a+weight_b;
2626
}, 0);
2727
};

0 commit comments

Comments
 (0)