[vm] Ensure 'print' is atomic between printing the string and '\n'

Should fix https://github.com/dart-lang/sdk/issues/53471

TEST=ci

Change-Id: I76da5776bb95f8297ef63aa4c8754c940e1d4e71
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330999
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
asiva
2023-11-03 20:02:45 +00:00
committed by Commit Queue
parent 258863c6d1
commit 1d3d819ecf
7 changed files with 110 additions and 34 deletions
+29
View File
@@ -2241,6 +2241,17 @@ DART_EXPORT Dart_Handle Dart_BooleanValue(Dart_Handle boolean_obj, bool* value);
*/
DART_EXPORT Dart_Handle Dart_StringLength(Dart_Handle str, intptr_t* length);
/**
* Gets the length of UTF-8 encoded representation for a string.
*
* \param str A String.
* \param length Returns the length of UTF-8 encoded representation for string.
*
* \return A valid handle if no error occurs during the operation.
*/
DART_EXPORT Dart_Handle Dart_StringUTF8Length(Dart_Handle str,
intptr_t* length);
/**
* Returns a String built from the provided C string
* (There is an implicit assumption that the C string passed in contains
@@ -2368,6 +2379,24 @@ DART_EXPORT Dart_Handle Dart_StringToUTF8(Dart_Handle str,
uint8_t** utf8_array,
intptr_t* length);
/**
* Copies the UTF-8 encoded representation of a String into specified buffer.
*
* Any unpaired surrogate code points in the string will be converted as
* replacement characters (U+FFFD, 0xEF 0xBF 0xBD in UTF-8).
*
* \param str A string.
* \param utf8_array Buffer into which the UTF-8 encoded representation of
* the string is copied into.
* The buffer is allocated and managed by the caller.
* \param length Specifies the length of the buffer passed in.
*
* \return A valid handle if no error occurs during the operation.
*/
DART_EXPORT Dart_Handle Dart_CopyUTF8EncodingOfString(Dart_Handle str,
uint8_t* utf8_array,
intptr_t length);
/**
* Gets the data corresponding to the string object. This function returns
* the data only for Latin-1 (ISO-8859-1) string objects. For all other