<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On 20 February 2015 at 19:46, Enrico Granata <span dir="ltr"><<a href="mailto:egranata@apple.com" target="_blank">egranata@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":1tt" class="a3s" style="overflow:hidden">+Error<br>
+OptionValueLanguage::SetValueFromString (llvm::StringRef value, VarSetOperationType op)<br>
+{<br>
+    Error error;<br>
+    switch (op)<br>
+    {<br>
+    case eVarSetOperationClear:<br>
+        Clear();<br>
+        break;<br>
+<br>
+    case eVarSetOperationReplace:<br>
+    case eVarSetOperationAssign:<br>
+        {<br>
+            LanguageType new_type = LanguageRuntime::GetLanguageTypeFromString(value.data());</div></blockquote></div><br>Hi,</div><div class="gmail_extra"><br></div><div class="gmail_extra">llvm::StringRef::data() is not guaranteed to return a null terminated string. We would need to call value.str().c_str() here, or (even better) fix the receiver to operate on llvm::StringRef as well.</div><div class="gmail_extra"><br></div><div class="gmail_extra">cheers,</div><div class="gmail_extra">pl</div></div>