aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/LangRef.html4
-rw-r--r--lib/VMCore/Verifier.cpp7
2 files changed, 8 insertions, 3 deletions
diff --git a/docs/LangRef.html b/docs/LangRef.html
index 41128c3b23..096acf294a 100644
--- a/docs/LangRef.html
+++ b/docs/LangRef.html
@@ -763,8 +763,8 @@ a power of 2.</p>
</div>
<div class="doc_text">
<p>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 <a href="#linkage">linkage type</a>, and an
+ function, global variable, another alias or bitcast of global value). Aliases
+ may have an optional <a href="#linkage">linkage type</a>, and an
optional <a href="#visibility">visibility style</a>.</p>
<h5>Syntax:</h5>
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp
index 6126253bfb..f6bc4b9db0 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);
}