Skip to content

Commit

Permalink
[GR-45963] Prevent from racy access to Breakpoint.debugger field.
Browse files Browse the repository at this point in the history
PullRequest: graal/15641
entlicher committed Oct 13, 2023
2 parents 0ec1bbc + 8508767 commit 8da77cd
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -594,14 +594,15 @@ public void onLoad(LoadSourceSectionEvent event) {
boolean doAssign;
EventBinding<?> execBinding = null;
synchronized (this) {
if (debugger == null) {
Debugger dbg = debugger;
if (dbg == null) {
// disposed
return;
}
if (!(doAssign = executedSources.contains(source))) {
SourceSection oldSection = loadedSections.put(source, section);
if (oldSection == null) {
execBinding = debugger.getInstrumenter().createExecuteSourceBinding(SourceFilter.newBuilder().sourceIs(source).build(), this, true);
execBinding = dbg.getInstrumenter().createExecuteSourceBinding(SourceFilter.newBuilder().sourceIs(source).build(), this, true);
if (executeBindings.putIfAbsent(source, execBinding) != null) {
execBinding = null;
}

0 comments on commit 8da77cd

Please sign in to comment.