Index: src/feedback-vector.cc |
diff --git a/src/feedback-vector.cc b/src/feedback-vector.cc |
index 4003068e9b5960e7af1b332c2b926abd9b5c68ba..5d842763994c75d047839b9423b2d2be298b744d 100644 |
--- a/src/feedback-vector.cc |
+++ b/src/feedback-vector.cc |
@@ -591,6 +591,10 @@ int CallICNexus::ExtractCallCount() { |
float CallICNexus::ComputeCallFrequency() { |
double const invocation_count = vector()->invocation_count(); |
double const call_count = ExtractCallCount(); |
+ if (invocation_count == 0) { |
+ // Prevent division by 0. |
+ return 0.0f; |
+ } |
return static_cast<float>(call_count / invocation_count); |
} |