Revert r199628: "[AArch64 NEON] Fix a bug caused by undef lane when generating VEXT."
[oota-llvm.git] / lib / IR / Value.cpp
index 62a3b31c18b21295931f79c180244b22d5f60423..2c90383edd8c2ecff8e015ac161529f94f216758 100644 (file)
@@ -182,6 +182,8 @@ void Value::setName(const Twine &NewName) {
 
   SmallString<256> NameData;
   StringRef NameRef = NewName.toStringRef(NameData);
+  assert(NameRef.find_first_of(0) == StringRef::npos &&
+         "Null bytes are not allowed in names");
 
   // Name isn't changing?
   if (getName() == NameRef)