[llvm] [SystemZ][z/OS] yaml2obj GOFF symbols (PR #75971)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 11 00:59:26 PST 2024


================
@@ -245,6 +248,57 @@ void GOFFState::writeHeader(GOFFYAML::FileHeader &FileHdr) {
   }
 }
 
+void GOFFState::writeSymbol(GOFFYAML::Symbol Sym) {
+  if (Sym.ID != SymbolID + 1)
+    reportError("symbol IDs not monotonic " + Sym.Name);
+  else
+    ++SymbolID;
+  if (Sym.OwnerID >= SymbolID)
+    reportError("owner ID not defined " + Sym.Name);
----------------
jh7370 wrote:

Same comment as above: is this absolutely necessary? Could you (in a malformed input object) have an owner ID field that isn't valid?

https://github.com/llvm/llvm-project/pull/75971


More information about the llvm-commits mailing list