Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
* Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -345,6 +345,10 @@ public VmExceptionBuilder withInsertedStackFrames(
return this;
}

public VmExceptionBuilder stackOverflowError() {
return evalError("stackOverflow");
}

public VmException build() {
if (message == null) {
throw new IllegalStateException("No message set.");
Expand Down
2 changes: 1 addition & 1 deletion pkl-core/src/main/java/org/pkl/core/runtime/VmTyped.java
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public int hashCode() {

for (var key : clazz.getAllRegularPropertyNames()) {
var value = getCachedValue(key);
assert value != null;
if (value == null) throw new VmExceptionBuilder().stackOverflowError().build();
result = 31 * result + value.hashCode();
}

Expand Down