[llvm-branch-commits] [libcxx] r325219 - Merging r325147:

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Feb 15 00:22:12 PST 2018


Author: hans
Date: Thu Feb 15 00:22:12 2018
New Revision: 325219

URL: http://llvm.org/viewvc/llvm-project?rev=325219&view=rev
Log:
Merging r325147:
------------------------------------------------------------------------
r325147 | marshall | 2018-02-14 19:05:25 +0100 (Wed, 14 Feb 2018) | 3 lines

Add a catch for std::length_error for the case where the string can't handle 2GB. (like say 32-bit big-endian)


------------------------------------------------------------------------

Modified:
    libcxx/branches/release_60/   (props changed)
    libcxx/branches/release_60/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/pbump2gig.pass.cpp

Propchange: libcxx/branches/release_60/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Feb 15 00:22:12 2018
@@ -1,2 +1,2 @@
 /libcxx/branches/apple:136569-137939
-/libcxx/trunk:321963,324153,324855
+/libcxx/trunk:321963,324153,324855,325147

Modified: libcxx/branches/release_60/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/pbump2gig.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/branches/release_60/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/pbump2gig.pass.cpp?rev=325219&r1=325218&r2=325219&view=diff
==============================================================================
--- libcxx/branches/release_60/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/pbump2gig.pass.cpp (original)
+++ libcxx/branches/release_60/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/pbump2gig.pass.cpp Thu Feb 15 00:22:12 2018
@@ -32,12 +32,13 @@ int main()
 #ifndef TEST_HAS_NO_EXCEPTIONS
     try {
 #endif
-    	std::string str(2147483648, 'a');
-		SB sb;
-		sb.str(str);
-		assert(sb.pubpbase() <= sb.pubpptr());
+        std::string str(2147483648, 'a');
+        SB sb;
+        sb.str(str);
+        assert(sb.pubpbase() <= sb.pubpptr());
 #ifndef TEST_HAS_NO_EXCEPTIONS
-	}
-	catch (const std::bad_alloc &) {}
+    }
+    catch (const std::length_error &) {} // maybe the string can't take 2GB
+    catch (const std::bad_alloc    &) {} // maybe we don't have enough RAM
 #endif
 }




More information about the llvm-branch-commits mailing list