Aliases act as "second name" for the aliasee value (which can be either
- function or global variable or bitcast of global value). Aliases may have an
- optional linkage type, and an
+ function, global variable, another alias or bitcast of global value). Aliases
+ may have an optional linkage type, and an
optional visibility style.
Syntax:
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp
index 6126253bfb9..f6bc4b9db0d 100644
--- a/lib/VMCore/Verifier.cpp
+++ b/lib/VMCore/Verifier.cpp
@@ -377,7 +377,12 @@ void Verifier::visitGlobalAlias(GlobalAlias &GA) {
"Aliasee should be either GlobalValue or bitcast of GlobalValue",
&GA);
}
-
+
+ const GlobalValue* Aliasee = GA.resolveAliasedGlobal();
+ Assert1(Aliasee,
+ "Aliasing chain should end with global function or global variable",
+ &GA);
+
visitGlobalValue(GA);
}