Преглед изворни кода

[codeview] don't try to emit variable locations without registers

This fixes a problem introduced 311957, where the compiler would crash
with "fatal error: error in backend: unknown codeview register".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311969 91177308-0d34-0410-b5e6-96231b3b80d8
Bob Haarman пре 8 година
родитељ
комит
20e39f8d14
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      lib/CodeGen/AsmPrinter/CodeViewDebug.cpp

+ 1 - 1
lib/CodeGen/AsmPrinter/CodeViewDebug.cpp

@@ -988,7 +988,7 @@ void CodeViewDebug::calculateRanges(
     }
 
     // If we don't know how to handle this range, skip past it.
-    if (!Supported || (Location.Offset && !Location.InMemory))
+    if (!Supported || Location.Register == 0 || (Location.Offset && !Location.InMemory))
       continue;
 
     // Handle the two cases we can handle: indirect in memory and in register.