Commit a9e3d9c7 authored by Benedikt Meurer's avatar Benedikt Meurer Committed by Commit Bot

[turbofan] Fix Type::PrintTo() for union and tuple types.

Printing of both union and tuple types was broken such that the first
type was always skipped due to a bug.

Bug: v8:8015
Change-Id: I4bd215a9d8fa5bc7e017dd28e66512f4961228d1
Reviewed-on: https://chromium-review.googlesource.com/1199365Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55569}
parent 29bea26b
......@@ -1010,14 +1010,16 @@ void Type::PrintTo(std::ostream& os) const {
os << "(";
for (int i = 0, n = this->AsUnion()->Length(); i < n; ++i) {
Type type_i = this->AsUnion()->Get(i);
if (i > 0) os << " | " << type_i;
if (i > 0) os << " | ";
os << type_i;
}
os << ")";
} else if (this->IsTuple()) {
os << "<";
for (int i = 0, n = this->AsTuple()->Arity(); i < n; ++i) {
Type type_i = this->AsTuple()->Element(i);
if (i > 0) os << ", " << type_i;
if (i > 0) os << ", ";
os << type_i;
}
os << ">";
} else {
......
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