Skip to content

Commit 9f38338

Browse files
alexmarkovCommit Queue
authored andcommitted
[vm] Cache LanguageError result of metadata evaluation
Copying of pragmas during hot reload (Library::CopyPragmas) relies on pragma metadata being fully evaluated in the earlier stage of hot reload (in Library::EvaluatePragmas()). However, if evaluation of metadata has ended with LanguageError, the result of evaluation was not cached and metadata remains in the unevaluated state, which triggers assertion in Library::CopyPragmas. This change adds caching of the metadata evaluation result if it ends with LanguageError. TEST=ffi/abi_specific_int_incomplete_jit_test Fixes #59665 Change-Id: I25e7b8f298f96ff4665e75fbbcbdb6b146c08f61 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/399200 Commit-Queue: Ryan Macnak <[email protected]> Reviewed-by: Ryan Macnak <[email protected]> Auto-Submit: Alexander Markov <[email protected]>
1 parent 77c761f commit 9f38338

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

runtime/vm/object.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14207,7 +14207,7 @@ ObjectPtr Library::GetMetadata(const Object& declaration) const {
1420714207
}
1420814208
if (!value.IsSmi()) {
1420914209
// Metadata is already evaluated.
14210-
ASSERT(value.IsArray());
14210+
ASSERT(value.IsArray() || value.IsLanguageError());
1421114211
return value.ptr();
1421214212
}
1421314213
const auto& smi_value = Smi::Cast(value);
@@ -14218,7 +14218,8 @@ ObjectPtr Library::GetMetadata(const Object& declaration) const {
1421814218
*this, kernel_offset,
1421914219
/* is_annotations_offset = */ declaration.IsLibrary() ||
1422014220
declaration.IsNamespace()));
14221-
if (evaluated_value.IsArray() || evaluated_value.IsNull()) {
14221+
if (evaluated_value.IsArray() || evaluated_value.IsNull() ||
14222+
evaluated_value.IsLanguageError()) {
1422214223
ASSERT(evaluated_value.ptr() != Object::empty_array().ptr());
1422314224
SafepointWriteRwLocker ml(thread, thread->isolate_group()->program_lock());
1422414225
MetadataMap map(metadata());

0 commit comments

Comments
 (0)