Skip to content

Commit 4c43103

Browse files
aamCommit Queue
authored andcommitted
[vm/tags] Ensure current tag is set to default only if it was not previously set.
The isolate creation callback might have set up current tag, so we dont' want to override it. Fixes #61505 TEST=flutter ci Change-Id: I18e7f60a9c41e96c9754476db17ad97d3d668949 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/449604 Reviewed-by: Ryan Macnak <[email protected]> Commit-Queue: Alexander Aprelev <[email protected]>
1 parent 0d75724 commit 4c43103

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

runtime/vm/thread.cc

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -437,11 +437,14 @@ void Thread::EnterIsolate(Isolate* isolate) {
437437
thread->ExitSafepoint();
438438
}
439439

440-
StackZone zone(thread);
441-
HANDLESCOPE(thread);
442-
if (group->tag_table() != GrowableObjectArray::null()) {
443-
const UserTag& default_tag = UserTag::Handle(UserTag::DefaultTag(thread));
444-
thread->set_current_tag(default_tag);
440+
if (thread->current_tag() == UserTag::null()) {
441+
// Set up current tag if it was not set up by the callback.
442+
StackZone zone(thread);
443+
HANDLESCOPE(thread);
444+
if (group->tag_table() != GrowableObjectArray::null()) {
445+
const UserTag& default_tag = UserTag::Handle(UserTag::DefaultTag(thread));
446+
thread->set_current_tag(default_tag);
447+
}
445448
}
446449

447450
ASSERT(!thread->IsAtSafepoint());

0 commit comments

Comments
 (0)