Skip to content

Commit ff0fe7b

Browse files
committed
Add comments explaining when unexpected specializations may be run.
1 parent bbb0d74 commit ff0fe7b

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/main/java/org/truffleruby/cext/CExtNodes.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1402,7 +1402,8 @@ public DynamicObject addToMarkList(VirtualFrame frmae, TruffleObject guardedObje
14021402

14031403
@Fallback
14041404
public DynamicObject addToMarkList(VirtualFrame frmae, Object guardedObject) {
1405-
// Do nothing for unexpected objects, no matter how unexpected.
1405+
// Do nothing for unexpected objects, no matter how unexpected. This can occur inside
1406+
// macros that guard a variable which may not have been initialized.
14061407
return nil();
14071408
}
14081409

src/main/java/org/truffleruby/cext/UnwrapNode.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ public Object unwrapTaggedObject(long handle) {
7373

7474
@Fallback
7575
public ValueWrapper unWrapUnexpectedHandle(long handle) {
76+
// Avoid throwing a specialization exception when given an uninitialized or corrupt
77+
// handle.
7678
return null;
7779
}
7880

@@ -118,6 +120,8 @@ public ValueWrapper unwrapTaggedObject(long handle) {
118120

119121
@Fallback
120122
public ValueWrapper unWrapUnexpectedHandle(long handle) {
123+
// Avoid throwing a specialization exception when given an uninitialized or corrupt
124+
// handle.
121125
return null;
122126
}
123127

0 commit comments

Comments
 (0)