summaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/lib/ObjectYAML/DWARFEmitter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/llvm/lib/ObjectYAML/DWARFEmitter.cpp')
-rw-r--r--contrib/llvm-project/llvm/lib/ObjectYAML/DWARFEmitter.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/contrib/llvm-project/llvm/lib/ObjectYAML/DWARFEmitter.cpp b/contrib/llvm-project/llvm/lib/ObjectYAML/DWARFEmitter.cpp
index 2ae66997cf59..b410fed16f09 100644
--- a/contrib/llvm-project/llvm/lib/ObjectYAML/DWARFEmitter.cpp
+++ b/contrib/llvm-project/llvm/lib/ObjectYAML/DWARFEmitter.cpp
@@ -314,7 +314,10 @@ public:
DIEFixupVisitor(DWARFYAML::Data &DI) : DWARFYAML::Visitor(DI){};
private:
- virtual void onStartCompileUnit(DWARFYAML::Unit &CU) { Length = 7; }
+ virtual void onStartCompileUnit(DWARFYAML::Unit &CU) {
+ // Size of the unit header, excluding the length field itself.
+ Length = CU.Version >= 5 ? 8 : 7;
+ }
virtual void onEndCompileUnit(DWARFYAML::Unit &CU) {
CU.Length.setLength(Length);