fix: [ASAN] devive by zero

This commit is contained in:
Ganlin Zhao 2022-11-21 18:01:48 +08:00
parent 2bdb86e287
commit 4f176e325d
1 changed files with 2 additions and 0 deletions

View File

@ -24,6 +24,8 @@ static double tlog2(double v, double base) {
return a; return a;
} else if (isnan(b) || isinf(b)) { } else if (isnan(b) || isinf(b)) {
return b; return b;
} else if (b == 0) {
return INFINITY;
} else { } else {
return a / b; return a / b;
} }