Commit 1f53653e authored by adamk's avatar adamk Committed by Commit bot

Fix crash in --print-scopes when Scope::variables_ is empty

Apparently our HashMap can't deal with iteration over an empty map.

R=verwaest@chromium.org,neis@chromium.org
BUG=v8:5711

Review-Url: https://codereview.chromium.org/2551943003
Cr-Commit-Position: refs/heads/master@{#41535}
parent 52e2c154
......@@ -1556,8 +1556,10 @@ void Scope::Print(int n) {
PrintVar(n1, function);
}
PrintMap(n1, "// local vars:\n", &variables_, true, function);
PrintMap(n1, "// dynamic vars:\n", &variables_, false, function);
if (variables_.occupancy() > 0) {
PrintMap(n1, "// local vars:\n", &variables_, true, function);
PrintMap(n1, "// dynamic vars:\n", &variables_, false, function);
}
// Print inner scopes (disable by providing negative n).
if (n >= 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment