You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: inform7/Internal/Extensions/Graham Nelson/Basic Inform.i7xd/Materials/Inter/Architecture32Kit/Sections/Glk.i6t
+27-1Lines changed: 27 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -745,6 +745,10 @@ A simple framework for handling hyperlinks in an interoperable manner.
745
745
We combine a hyperlink tag with a payload in one 32-bit value. The tag is stored
746
746
in the lowest bits, and the payload above it.
747
747
748
+
|CALCULATE_HYPERLINK_TAG_WIDTH_R| is a |before starting the virtual machine| rule,
749
+
which gets the number of options in the hyperlink tag enum and sets the tag/payload
750
+
masks and widths accordingly.
751
+
748
752
=
749
753
Global hyperlink_payload_mask;
750
754
Global hyperlink_tag_mask;
@@ -769,8 +773,30 @@ Global hyperlink_value;
769
773
rfalse;
770
774
];
771
775
772
-
[ MakeTaggedHyperlink tag val;
776
+
@ |MakeTaggedHyperlink| combines the tag and value into one 32 bit hyperlink ID,
777
+
checking that the value is not a pointer to ephemeral data (on the stack).
778
+
779
+
|HANDLE_HYPERLINK_R| then extracts tag and value from an ID, expanding the value
780
+
back to 32 bits.
781
+
782
+
=
783
+
784
+
[ MakeTaggedHyperlink tag val kind;
773
785
if (Cached_Glk_Gestalts-->gestalt_Hyperlinks) {
786
+
#Ifdef DEBUG;
787
+
if (val >= blockv_stack && val < (blockv_stack + BLOCKV_STACK_SIZE * WORDSIZE)) {
788
+
if (kind) {
789
+
if (KindConformsTo_POINTER_VALUE_TY(kind)) {
790
+
! Break up the message so that Inform doesn't think it's an Inter invocation
791
+
print "Error: cannot make hyperlink from ephemeral value; try creating with {", "-by-reference:V}^";
792
+
return;
793
+
}
794
+
}
795
+
else {
796
+
print "Warning: hyperlink value might be ephemeral; try creating with explicit kind^";
0 commit comments