From 4e8c339a5ab327aa896a761fc33fd9ae4be57718 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 6 Feb 2019 12:59:14 -0800 Subject: fix printing of unreachable atomics, and add print fuzzing (#1899) --- src/passes/Print.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/passes/Print.cpp') diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index 761c9e3d4..c511af434 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -206,7 +206,7 @@ struct PrintExpressionContents : public Visitor { case Xor: o << "xor"; break; case Xchg: o << "xchg"; break; } - if (curr->bytes != getTypeSize(curr->type)) { + if (curr->type != unreachable && curr->bytes != getTypeSize(curr->type)) { o << "_u"; } restoreNormalColor(o); @@ -218,7 +218,7 @@ struct PrintExpressionContents : public Visitor { prepareColor(o); printRMWSize(o, curr->type, curr->bytes); o << "cmpxchg"; - if (curr->bytes != getTypeSize(curr->type)) { + if (curr->type != unreachable && curr->bytes != getTypeSize(curr->type)) { o << "_u"; } restoreNormalColor(o); -- cgit v1.2.3