Created
December 5, 2011 18:29
-
-
Save seandenigris/1434683 to your computer and use it in GitHub Desktop.
Cog VM (Squeak/Pharo Smalltalk) Hack: Skip Message Send (C part)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Skip over specified selector from the VM. Useful for when an error is preventing your image from starting. See http://forum.world.st/Fwd-Oops-I-put-a-halt-in-a-startup-method-td3800729.html for details */ | |
char* realSelector = GIV(messageSelector) + BaseHeaderSize; | |
char* selectorToSkip = "restoreFrom:"; | |
int selectorLength = lengthOf(messageSelector); | |
int sameSize = selectorLength == strlen(selectorToSkip); | |
int matches = strncmp(realSelector, selectorToSkip, selectorLength) == 0; | |
if (sameSize && matches) { | |
printf("Skipping "); | |
printActivationNameForSelectorstartClass(GIV(messageSelector), GIV(lkupClass)); | |
printf("\n"); | |
} | |
else { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment