Author: eliot Date: 2012-04-17 23:14:23 -0700 (Tue, 17 Apr 2012) New Revision: 2550 Modified: branches/Cog/nscogsrc/vm/cogit.c branches/Cog/nscogsrc/vm/cogit.h branches/Cog/nscogsrc/vm/cogmethod.h branches/Cog/nscogsrc/vm/cointerp.c branches/Cog/nscogsrc/vm/cointerp.h branches/Cog/nscogsrc/vm/gcc3x-cointerp.c branches/Cog/nscogsrc/vm/interp.h branches/Cog/nscogsrc/vm/vmCallback.h branches/Cog/platforms/Cross/vm/sqSCCSVersion.h branches/Cog/src/vm/cogit.c branches/Cog/src/vm/cogit.h branches/Cog/src/vm/cogmethod.h branches/Cog/src/vm/cointerp.c branches/Cog/src/vm/cointerp.h branches/Cog/src/vm/cointerpmt.c branches/Cog/src/vm/cointerpmt.h branches/Cog/src/vm/gcc3x-cointerp.c branches/Cog/src/vm/gcc3x-cointerpmt.c branches/Cog/src/vm/interp.h branches/Cog/src/vm/vmCallback.h Log: CogVM source as per VMMaker.oscog-eem.157. Implement proper bounds checking for byte access to compiled methods. Raise errors for accesses outside initialPC to size. Modified: branches/Cog/nscogsrc/vm/cogit.c =================================================================== --- branches/Cog/nscogsrc/vm/cogit.c 2012-04-13 18:28:27 UTC (rev 2549) +++ branches/Cog/nscogsrc/vm/cogit.c 2012-04-18 06:14:23 UTC (rev 2550) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.156 uuid: f03602f8-cb8a-4ae7-9a2e-921b5b77cf01 + CCodeGenerator VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc from - StackToRegisterMappingCogit VMMaker.oscog-eem.156 uuid: f03602f8-cb8a-4ae7-9a2e-921b5b77cf01 + StackToRegisterMappingCogit VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc */ -static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.156 uuid: f03602f8-cb8a-4ae7-9a2e-921b5b77cf01 " __DATE__ ; +static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc " __DATE__ ; char *__cogitBuildInfo = __buildInfo; @@ -9283,6 +9283,7 @@ sqInt jnx; AbstractInstruction *jumpBounds; AbstractInstruction *jumpFmtEq2; + AbstractInstruction *jumpFmtGt11; AbstractInstruction *jumpFmtGt4; AbstractInstruction *jumpFmtIs2; AbstractInstruction *jumpFmtLe4; @@ -9426,6 +9427,10 @@ genoperandoperand(CmpCqR, 8, ClassReg); /* begin JumpLess: */ jumpFmtLt8 = genoperand(JumpLess, ((sqInt)0)); + /* begin CmpCq:R: */ + genoperandoperand(CmpCqR, 11, ClassReg); + /* begin JumpGreater: */ + jumpFmtGt11 = genoperand(JumpGreater, ((sqInt)0)); /* begin AddCq:R: */ genoperandoperand(AddCqR, BaseHeaderSize, Arg1Reg); /* begin MoveXbr:R:R: */ @@ -9451,7 +9456,7 @@ genoperandoperand(MoveRR, TempReg, ReceiverResultReg); /* begin RetN: */ genoperand(RetN, retNoffset); - jmpTarget(jumpSI, jmpTarget(jumpNotSI, jmpTarget(jumpNotIndexable, jmpTarget(jumpIsContext, jmpTarget(jumpBounds, gLabel()))))); + jmpTarget(jumpSI, jmpTarget(jumpNotSI, jmpTarget(jumpNotIndexable, jmpTarget(jumpIsContext, jmpTarget(jumpBounds, jmpTarget(jumpFmtGt11, gLabel())))))); return 0; } Modified: branches/Cog/nscogsrc/vm/cogit.h =================================================================== --- branches/Cog/nscogsrc/vm/cogit.h 2012-04-13 18:28:27 UTC (rev 2549) +++ branches/Cog/nscogsrc/vm/cogit.h 2012-04-18 06:14:23 UTC (rev 2550) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.156 uuid: f03602f8-cb8a-4ae7-9a2e-921b5b77cf01 + CCodeGenerator VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc */ Modified: branches/Cog/nscogsrc/vm/cogmethod.h =================================================================== --- branches/Cog/nscogsrc/vm/cogmethod.h 2012-04-13 18:28:27 UTC (rev 2549) +++ branches/Cog/nscogsrc/vm/cogmethod.h 2012-04-18 06:14:23 UTC (rev 2550) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.156 uuid: f03602f8-cb8a-4ae7-9a2e-921b5b77cf01 + CCodeGenerator VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc */ typedef struct { Modified: branches/Cog/nscogsrc/vm/cointerp.c =================================================================== --- branches/Cog/nscogsrc/vm/cointerp.c 2012-04-13 18:28:27 UTC (rev 2549) +++ branches/Cog/nscogsrc/vm/cointerp.c 2012-04-18 06:14:23 UTC (rev 2550) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.156 uuid: f03602f8-cb8a-4ae7-9a2e-921b5b77cf01 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc from - CoInterpreter VMMaker.oscog-eem.156 uuid: f03602f8-cb8a-4ae7-9a2e-921b5b77cf01 + CoInterpreter VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc */ -static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.156 uuid: f03602f8-cb8a-4ae7-9a2e-921b5b77cf01 " __DATE__ ; +static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -1916,7 +1916,7 @@ /* 575 */ (void (*)(void))0, 0 }; static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void); -const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.156"; +const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.157"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */; volatile int sendTrace; @@ -8001,8 +8001,11 @@ goto l98; } else { - result = (((byteAt((rcvr + BaseHeaderSize) + (((index >> 1)) - 1))) << 1) | 1); - goto l98; + if ((fmt < 12) + || (((index >> 1)) >= ((((literalCountOf(rcvr)) + LiteralStart) * BytesPerWord) + 1))) { + result = (((byteAt((rcvr + BaseHeaderSize) + (((index >> 1)) - 1))) << 1) | 1); + goto l98; + } } } /* begin primitiveFailFor: */ @@ -8112,25 +8115,25 @@ goto l101; } if (fmt >= 16) { - - /* Note fmt >= 16 is an artificial flag for strings */ - - valToPut = asciiOfCharacter(value); - if (!(!GIV(primFailCode))) { + if (!(isinstanceOfcompactClassIndex(value, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassCharacter << ShiftForWord)), 0))) { + GIV(primFailCode) = PrimErrBadArgument; goto l101; } + valToPut = longAt((value + BaseHeaderSize) + (CharacterValueIndex << ShiftForWord)); } else { + if ((fmt >= 12) + && (((index >> 1)) < ((((literalCountOf(rcvr)) + LiteralStart) * BytesPerWord) + 1))) { + GIV(primFailCode) = PrimErrBadIndex; + goto l101; + } valToPut = value; } if ((valToPut & 1)) { valToPut = (valToPut >> 1); if (!((valToPut >= 0) && (valToPut <= 255))) { - /* begin primitiveFail */ - if (!GIV(primFailCode)) { - GIV(primFailCode) = 1; - } + GIV(primFailCode) = PrimErrBadArgument; goto l101; } byteAtput((rcvr + BaseHeaderSize) + (((index >> 1)) - 1), valToPut); @@ -12937,25 +12940,25 @@ goto l1; } if (fmt >= 16) { - - /* Note fmt >= 16 is an artificial flag for strings */ - - valToPut = asciiOfCharacter(value); - if (!(!GIV(primFailCode))) { + if (!(isinstanceOfcompactClassIndex(value, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassCharacter << ShiftForWord)), 0))) { + GIV(primFailCode) = PrimErrBadArgument; goto l1; } + valToPut = longAt((value + BaseHeaderSize) + (CharacterValueIndex << ShiftForWord)); } else { + if ((fmt >= 12) + && (index < ((((literalCountOf(rcvr)) + LiteralStart) * BytesPerWord) + 1))) { + GIV(primFailCode) = PrimErrBadIndex; + goto l1; + } valToPut = value; } if ((valToPut & 1)) { valToPut = (valToPut >> 1); if (!((valToPut >= 0) && (valToPut <= 255))) { - /* begin primitiveFail */ - if (!GIV(primFailCode)) { - GIV(primFailCode) = 1; - } + GIV(primFailCode) = PrimErrBadArgument; goto l1; } byteAtput((rcvr + BaseHeaderSize) + (index - 1), valToPut); @@ -13073,8 +13076,11 @@ goto l1; } else { - result = (((byteAt((rcvr + BaseHeaderSize) + (index - 1))) << 1) | 1); - goto l1; + if ((fmt < 12) + || (index >= ((((literalCountOf(rcvr)) + LiteralStart) * BytesPerWord) + 1))) { + result = (((byteAt((rcvr + BaseHeaderSize) + (index - 1))) << 1) | 1); + goto l1; + } } } /* begin primitiveFailFor: */ @@ -43937,7 +43943,9 @@ else { stSize = totalLength - fixedFields; } - if (((((usqInt) index)) >= (((usqInt) 1))) + if ((oopisGreaterThanOrEqualTo(index, (fmt >= 12 + ? (((literalCountOfHeader(headerOf(array))) + LiteralStart) * BytesPerWord) + 1 + : 1))) && ((((usqInt) index)) <= (((usqInt) stSize)))) { /* begin subscript:with:format: */ if (fmt <= 4) { @@ -44055,7 +44063,9 @@ else { stSize = totalLength - fixedFields; } - if (((((usqInt) index)) >= (((usqInt) 1))) + if ((oopisGreaterThanOrEqualTo(index, (fmt >= 12 + ? (((literalCountOfHeader(headerOf(array))) + LiteralStart) * BytesPerWord) + 1 + : 1))) && ((((usqInt) index)) <= (((usqInt) stSize)))) { /* begin subscript:with:storing:format: */ VM_LABEL(2subscriptwithstoringformat); Modified: branches/Cog/nscogsrc/vm/cointerp.h =================================================================== --- branches/Cog/nscogsrc/vm/cointerp.h 2012-04-13 18:28:27 UTC (rev 2549) +++ branches/Cog/nscogsrc/vm/cointerp.h 2012-04-18 06:14:23 UTC (rev 2550) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.156 uuid: f03602f8-cb8a-4ae7-9a2e-921b5b77cf01 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc */ Modified: branches/Cog/nscogsrc/vm/gcc3x-cointerp.c =================================================================== --- branches/Cog/nscogsrc/vm/gcc3x-cointerp.c 2012-04-13 18:28:27 UTC (rev 2549) +++ branches/Cog/nscogsrc/vm/gcc3x-cointerp.c 2012-04-18 06:14:23 UTC (rev 2550) @@ -2,11 +2,11 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.156 uuid: f03602f8-cb8a-4ae7-9a2e-921b5b77cf01 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc from - CoInterpreter VMMaker.oscog-eem.156 uuid: f03602f8-cb8a-4ae7-9a2e-921b5b77cf01 + CoInterpreter VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc */ -static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.156 uuid: f03602f8-cb8a-4ae7-9a2e-921b5b77cf01 " __DATE__ ; +static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -1919,7 +1919,7 @@ /* 575 */ (void (*)(void))0, 0 }; static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void); -const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.156"; +const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.157"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */; volatile int sendTrace; @@ -8005,8 +8005,11 @@ goto l98; } else { - result = (((byteAt((rcvr + BaseHeaderSize) + (((index >> 1)) - 1))) << 1) | 1); - goto l98; + if ((fmt < 12) + || (((index >> 1)) >= ((((literalCountOf(rcvr)) + LiteralStart) * BytesPerWord) + 1))) { + result = (((byteAt((rcvr + BaseHeaderSize) + (((index >> 1)) - 1))) << 1) | 1); + goto l98; + } } } /* begin primitiveFailFor: */ @@ -8116,25 +8119,25 @@ goto l101; } if (fmt >= 16) { - - /* Note fmt >= 16 is an artificial flag for strings */ - - valToPut = asciiOfCharacter(value); - if (!(!GIV(primFailCode))) { + if (!(isinstanceOfcompactClassIndex(value, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassCharacter << ShiftForWord)), 0))) { + GIV(primFailCode) = PrimErrBadArgument; goto l101; } + valToPut = longAt((value + BaseHeaderSize) + (CharacterValueIndex << ShiftForWord)); } else { + if ((fmt >= 12) + && (((index >> 1)) < ((((literalCountOf(rcvr)) + LiteralStart) * BytesPerWord) + 1))) { + GIV(primFailCode) = PrimErrBadIndex; + goto l101; + } valToPut = value; } if ((valToPut & 1)) { valToPut = (valToPut >> 1); if (!((valToPut >= 0) && (valToPut <= 255))) { - /* begin primitiveFail */ - if (!GIV(primFailCode)) { - GIV(primFailCode) = 1; - } + GIV(primFailCode) = PrimErrBadArgument; goto l101; } byteAtput((rcvr + BaseHeaderSize) + (((index >> 1)) - 1), valToPut); @@ -12941,25 +12944,25 @@ goto l1; } if (fmt >= 16) { - - /* Note fmt >= 16 is an artificial flag for strings */ - - valToPut = asciiOfCharacter(value); - if (!(!GIV(primFailCode))) { + if (!(isinstanceOfcompactClassIndex(value, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassCharacter << ShiftForWord)), 0))) { + GIV(primFailCode) = PrimErrBadArgument; goto l1; } + valToPut = longAt((value + BaseHeaderSize) + (CharacterValueIndex << ShiftForWord)); } else { + if ((fmt >= 12) + && (index < ((((literalCountOf(rcvr)) + LiteralStart) * BytesPerWord) + 1))) { + GIV(primFailCode) = PrimErrBadIndex; + goto l1; + } valToPut = value; } if ((valToPut & 1)) { valToPut = (valToPut >> 1); if (!((valToPut >= 0) && (valToPut <= 255))) { - /* begin primitiveFail */ - if (!GIV(primFailCode)) { - GIV(primFailCode) = 1; - } + GIV(primFailCode) = PrimErrBadArgument; goto l1; } byteAtput((rcvr + BaseHeaderSize) + (index - 1), valToPut); @@ -13077,8 +13080,11 @@ goto l1; } else { - result = (((byteAt((rcvr + BaseHeaderSize) + (index - 1))) << 1) | 1); - goto l1; + if ((fmt < 12) + || (index >= ((((literalCountOf(rcvr)) + LiteralStart) * BytesPerWord) + 1))) { + result = (((byteAt((rcvr + BaseHeaderSize) + (index - 1))) << 1) | 1); + goto l1; + } } } /* begin primitiveFailFor: */ @@ -43941,7 +43947,9 @@ else { stSize = totalLength - fixedFields; } - if (((((usqInt) index)) >= (((usqInt) 1))) + if ((oopisGreaterThanOrEqualTo(index, (fmt >= 12 + ? (((literalCountOfHeader(headerOf(array))) + LiteralStart) * BytesPerWord) + 1 + : 1))) && ((((usqInt) index)) <= (((usqInt) stSize)))) { /* begin subscript:with:format: */ if (fmt <= 4) { @@ -44059,7 +44067,9 @@ else { stSize = totalLength - fixedFields; } - if (((((usqInt) index)) >= (((usqInt) 1))) + if ((oopisGreaterThanOrEqualTo(index, (fmt >= 12 + ? (((literalCountOfHeader(headerOf(array))) + LiteralStart) * BytesPerWord) + 1 + : 1))) && ((((usqInt) index)) <= (((usqInt) stSize)))) { /* begin subscript:with:storing:format: */ VM_LABEL(2subscriptwithstoringformat); Modified: branches/Cog/nscogsrc/vm/interp.h =================================================================== --- branches/Cog/nscogsrc/vm/interp.h 2012-04-13 18:28:27 UTC (rev 2549) +++ branches/Cog/nscogsrc/vm/interp.h 2012-04-18 06:14:23 UTC (rev 2550) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.156 uuid: f03602f8-cb8a-4ae7-9a2e-921b5b77cf01 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc */ #define VM_PROXY_MAJOR 1 Modified: branches/Cog/nscogsrc/vm/vmCallback.h =================================================================== --- branches/Cog/nscogsrc/vm/vmCallback.h 2012-04-13 18:28:27 UTC (rev 2549) +++ branches/Cog/nscogsrc/vm/vmCallback.h 2012-04-18 06:14:23 UTC (rev 2550) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.156 uuid: f03602f8-cb8a-4ae7-9a2e-921b5b77cf01 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc */ #define VM_CALLBACK_INC 1 Property changes on: branches/Cog/platforms/Cross/vm/sqSCCSVersion.h ___________________________________________________________________ Modified: checkindate - Fri Apr 13 11:27:28 PDT 2012 + Tue Apr 17 23:13:00 PDT 2012 Modified: branches/Cog/src/vm/cogit.c =================================================================== --- branches/Cog/src/vm/cogit.c 2012-04-13 18:28:27 UTC (rev 2549) +++ branches/Cog/src/vm/cogit.c 2012-04-18 06:14:23 UTC (rev 2550) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.156 uuid: f03602f8-cb8a-4ae7-9a2e-921b5b77cf01 + CCodeGenerator VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc from - StackToRegisterMappingCogit VMMaker.oscog-eem.156 uuid: f03602f8-cb8a-4ae7-9a2e-921b5b77cf01 + StackToRegisterMappingCogit VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc */ -static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.156 uuid: f03602f8-cb8a-4ae7-9a2e-921b5b77cf01 " __DATE__ ; +static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc " __DATE__ ; char *__cogitBuildInfo = __buildInfo; @@ -9144,6 +9144,7 @@ sqInt jnx; AbstractInstruction *jumpBounds; AbstractInstruction *jumpFmtEq2; + AbstractInstruction *jumpFmtGt11; AbstractInstruction *jumpFmtGt4; AbstractInstruction *jumpFmtIs2; AbstractInstruction *jumpFmtLe4; @@ -9287,6 +9288,10 @@ genoperandoperand(CmpCqR, 8, ClassReg); /* begin JumpLess: */ jumpFmtLt8 = genoperand(JumpLess, ((sqInt)0)); + /* begin CmpCq:R: */ + genoperandoperand(CmpCqR, 11, ClassReg); + /* begin JumpGreater: */ + jumpFmtGt11 = genoperand(JumpGreater, ((sqInt)0)); /* begin AddCq:R: */ genoperandoperand(AddCqR, BaseHeaderSize, Arg1Reg); /* begin MoveXbr:R:R: */ @@ -9312,7 +9317,7 @@ genoperandoperand(MoveRR, TempReg, ReceiverResultReg); /* begin RetN: */ genoperand(RetN, retNoffset); - jmpTarget(jumpSI, jmpTarget(jumpNotSI, jmpTarget(jumpNotIndexable, jmpTarget(jumpIsContext, jmpTarget(jumpBounds, gLabel()))))); + jmpTarget(jumpSI, jmpTarget(jumpNotSI, jmpTarget(jumpNotIndexable, jmpTarget(jumpIsContext, jmpTarget(jumpBounds, jmpTarget(jumpFmtGt11, gLabel())))))); return 0; } Modified: branches/Cog/src/vm/cogit.h =================================================================== --- branches/Cog/src/vm/cogit.h 2012-04-13 18:28:27 UTC (rev 2549) +++ branches/Cog/src/vm/cogit.h 2012-04-18 06:14:23 UTC (rev 2550) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.156 uuid: f03602f8-cb8a-4ae7-9a2e-921b5b77cf01 + CCodeGenerator VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc */ Modified: branches/Cog/src/vm/cogmethod.h =================================================================== --- branches/Cog/src/vm/cogmethod.h 2012-04-13 18:28:27 UTC (rev 2549) +++ branches/Cog/src/vm/cogmethod.h 2012-04-18 06:14:23 UTC (rev 2550) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.156 uuid: f03602f8-cb8a-4ae7-9a2e-921b5b77cf01 + CCodeGenerator VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc */ typedef struct { Modified: branches/Cog/src/vm/cointerp.c =================================================================== --- branches/Cog/src/vm/cointerp.c 2012-04-13 18:28:27 UTC (rev 2549) +++ branches/Cog/src/vm/cointerp.c 2012-04-18 06:14:23 UTC (rev 2550) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.156 uuid: f03602f8-cb8a-4ae7-9a2e-921b5b77cf01 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc from - CoInterpreter VMMaker.oscog-eem.156 uuid: f03602f8-cb8a-4ae7-9a2e-921b5b77cf01 + CoInterpreter VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc */ -static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.156 uuid: f03602f8-cb8a-4ae7-9a2e-921b5b77cf01 " __DATE__ ; +static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -1906,7 +1906,7 @@ /* 575 */ (void (*)(void))0, 0 }; static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void); -const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.156]"; +const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.157]"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */; volatile int sendTrace; @@ -7760,8 +7760,11 @@ goto l93; } else { - result = (((byteAt((rcvr + BaseHeaderSize) + (((index >> 1)) - 1))) << 1) | 1); - goto l93; + if ((fmt < 12) + || (((index >> 1)) >= ((((literalCountOf(rcvr)) + LiteralStart) * BytesPerWord) + 1))) { + result = (((byteAt((rcvr + BaseHeaderSize) + (((index >> 1)) - 1))) << 1) | 1); + goto l93; + } } } /* begin primitiveFailFor: */ @@ -7871,25 +7874,25 @@ goto l96; } if (fmt >= 16) { - - /* Note fmt >= 16 is an artificial flag for strings */ - - valToPut = asciiOfCharacter(value); - if (!(!GIV(primFailCode))) { + if (!(isinstanceOfcompactClassIndex(value, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassCharacter << ShiftForWord)), 0))) { + GIV(primFailCode) = PrimErrBadArgument; goto l96; } + valToPut = longAt((value + BaseHeaderSize) + (CharacterValueIndex << ShiftForWord)); } else { + if ((fmt >= 12) + && (((index >> 1)) < ((((literalCountOf(rcvr)) + LiteralStart) * BytesPerWord) + 1))) { + GIV(primFailCode) = PrimErrBadIndex; + goto l96; + } valToPut = value; } if ((valToPut & 1)) { valToPut = (valToPut >> 1); if (!((valToPut >= 0) && (valToPut <= 255))) { - /* begin primitiveFail */ - if (!GIV(primFailCode)) { - GIV(primFailCode) = 1; - } + GIV(primFailCode) = PrimErrBadArgument; goto l96; } byteAtput((rcvr + BaseHeaderSize) + (((index >> 1)) - 1), valToPut); @@ -12557,25 +12560,25 @@ goto l1; } if (fmt >= 16) { - - /* Note fmt >= 16 is an artificial flag for strings */ - - valToPut = asciiOfCharacter(value); - if (!(!GIV(primFailCode))) { + if (!(isinstanceOfcompactClassIndex(value, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassCharacter << ShiftForWord)), 0))) { + GIV(primFailCode) = PrimErrBadArgument; goto l1; } + valToPut = longAt((value + BaseHeaderSize) + (CharacterValueIndex << ShiftForWord)); } else { + if ((fmt >= 12) + && (index < ((((literalCountOf(rcvr)) + LiteralStart) * BytesPerWord) + 1))) { + GIV(primFailCode) = PrimErrBadIndex; + goto l1; + } valToPut = value; } if ((valToPut & 1)) { valToPut = (valToPut >> 1); if (!((valToPut >= 0) && (valToPut <= 255))) { - /* begin primitiveFail */ - if (!GIV(primFailCode)) { - GIV(primFailCode) = 1; - } + GIV(primFailCode) = PrimErrBadArgument; goto l1; } byteAtput((rcvr + BaseHeaderSize) + (index - 1), valToPut); @@ -12693,8 +12696,11 @@ goto l1; } else { - result = (((byteAt((rcvr + BaseHeaderSize) + (index - 1))) << 1) | 1); - goto l1; + if ((fmt < 12) + || (index >= ((((literalCountOf(rcvr)) + LiteralStart) * BytesPerWord) + 1))) { + result = (((byteAt((rcvr + BaseHeaderSize) + (index - 1))) << 1) | 1); + goto l1; + } } } /* begin primitiveFailFor: */ @@ -43248,7 +43254,9 @@ else { stSize = totalLength - fixedFields; } - if (((((usqInt) index)) >= (((usqInt) 1))) + if ((oopisGreaterThanOrEqualTo(index, (fmt >= 12 + ? (((literalCountOfHeader(headerOf(array))) + LiteralStart) * BytesPerWord) + 1 + : 1))) && ((((usqInt) index)) <= (((usqInt) stSize)))) { /* begin subscript:with:format: */ if (fmt <= 4) { @@ -43366,7 +43374,9 @@ else { stSize = totalLength - fixedFields; } - if (((((usqInt) index)) >= (((usqInt) 1))) + if ((oopisGreaterThanOrEqualTo(index, (fmt >= 12 + ? (((literalCountOfHeader(headerOf(array))) + LiteralStart) * BytesPerWord) + 1 + : 1))) && ((((usqInt) index)) <= (((usqInt) stSize)))) { /* begin subscript:with:storing:format: */ VM_LABEL(2subscriptwithstoringformat); Modified: branches/Cog/src/vm/cointerp.h =================================================================== --- branches/Cog/src/vm/cointerp.h 2012-04-13 18:28:27 UTC (rev 2549) +++ branches/Cog/src/vm/cointerp.h 2012-04-18 06:14:23 UTC (rev 2550) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.156 uuid: f03602f8-cb8a-4ae7-9a2e-921b5b77cf01 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc */ Modified: branches/Cog/src/vm/cointerpmt.c =================================================================== --- branches/Cog/src/vm/cointerpmt.c 2012-04-13 18:28:27 UTC (rev 2549) +++ branches/Cog/src/vm/cointerpmt.c 2012-04-18 06:14:23 UTC (rev 2550) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.156 uuid: f03602f8-cb8a-4ae7-9a2e-921b5b77cf01 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc from - CoInterpreterMT VMMaker.oscog-eem.156 uuid: f03602f8-cb8a-4ae7-9a2e-921b5b77cf01 + CoInterpreterMT VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc */ -static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.156 uuid: f03602f8-cb8a-4ae7-9a2e-921b5b77cf01 " __DATE__ ; +static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -2005,7 +2005,7 @@ /* 575 */ (void (*)(void))0, 0 }; static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void); -const char *interpreterVersion = "Croquet Closure Cog MT VM [CoInterpreterMT VMMaker.oscog-eem.156]"; +const char *interpreterVersion = "Croquet Closure Cog MT VM [CoInterpreterMT VMMaker.oscog-eem.157]"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */; volatile int sendTrace; sqInt willNotThreadWarnCount; @@ -7861,8 +7861,11 @@ goto l93; } else { - result = (((byteAt((rcvr + BaseHeaderSize) + (((index >> 1)) - 1))) << 1) | 1); - goto l93; + if ((fmt < 12) + || (((index >> 1)) >= ((((literalCountOf(rcvr)) + LiteralStart) * BytesPerWord) + 1))) { + result = (((byteAt((rcvr + BaseHeaderSize) + (((index >> 1)) - 1))) << 1) | 1); + goto l93; + } } } /* begin primitiveFailFor: */ @@ -7972,25 +7975,25 @@ goto l96; } if (fmt >= 16) { - - /* Note fmt >= 16 is an artificial flag for strings */ - - valToPut = asciiOfCharacter(value); - if (!(!GIV(primFailCode))) { + if (!(isinstanceOfcompactClassIndex(value, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassCharacter << ShiftForWord)), 0))) { + GIV(primFailCode) = PrimErrBadArgument; goto l96; } + valToPut = longAt((value + BaseHeaderSize) + (CharacterValueIndex << ShiftForWord)); } else { + if ((fmt >= 12) + && (((index >> 1)) < ((((literalCountOf(rcvr)) + LiteralStart) * BytesPerWord) + 1))) { + GIV(primFailCode) = PrimErrBadIndex; + goto l96; + } valToPut = value; } if ((valToPut & 1)) { valToPut = (valToPut >> 1); if (!((valToPut >= 0) && (valToPut <= 255))) { - /* begin primitiveFail */ - if (!GIV(primFailCode)) { - GIV(primFailCode) = 1; - } + GIV(primFailCode) = PrimErrBadArgument; goto l96; } byteAtput((rcvr + BaseHeaderSize) + (((index >> 1)) - 1), valToPut); @@ -12963,25 +12966,25 @@ goto l1; } if (fmt >= 16) { - - /* Note fmt >= 16 is an artificial flag for strings */ - - valToPut = asciiOfCharacter(value); - if (!(!GIV(primFailCode))) { + if (!(isinstanceOfcompactClassIndex(value, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassCharacter << ShiftForWord)), 0))) { + GIV(primFailCode) = PrimErrBadArgument; goto l1; } + valToPut = longAt((value + BaseHeaderSize) + (CharacterValueIndex << ShiftForWord)); } else { + if ((fmt >= 12) + && (index < ((((literalCountOf(rcvr)) + LiteralStart) * BytesPerWord) + 1))) { + GIV(primFailCode) = PrimErrBadIndex; + goto l1; + } valToPut = value; } if ((valToPut & 1)) { valToPut = (valToPut >> 1); if (!((valToPut >= 0) && (valToPut <= 255))) { - /* begin primitiveFail */ - if (!GIV(primFailCode)) { - GIV(primFailCode) = 1; - } + GIV(primFailCode) = PrimErrBadArgument; goto l1; } byteAtput((rcvr + BaseHeaderSize) + (index - 1), valToPut); @@ -13099,8 +13102,11 @@ goto l1; } else { - result = (((byteAt((rcvr + BaseHeaderSize) + (index - 1))) << 1) | 1); - goto l1; + if ((fmt < 12) + || (index >= ((((literalCountOf(rcvr)) + LiteralStart) * BytesPerWord) + 1))) { + result = (((byteAt((rcvr + BaseHeaderSize) + (index - 1))) << 1) | 1); + goto l1; + } } } /* begin primitiveFailFor: */ @@ -44745,7 +44751,9 @@ else { stSize = totalLength - fixedFields; } - if (((((usqInt) index)) >= (((usqInt) 1))) + if ((oopisGreaterThanOrEqualTo(index, (fmt >= 12 + ? (((literalCountOfHeader(headerOf(array))) + LiteralStart) * BytesPerWord) + 1 + : 1))) && ((((usqInt) index)) <= (((usqInt) stSize)))) { /* begin subscript:with:format: */ if (fmt <= 4) { @@ -44863,7 +44871,9 @@ else { stSize = totalLength - fixedFields; } - if (((((usqInt) index)) >= (((usqInt) 1))) + if ((oopisGreaterThanOrEqualTo(index, (fmt >= 12 + ? (((literalCountOfHeader(headerOf(array))) + LiteralStart) * BytesPerWord) + 1 + : 1))) && ((((usqInt) index)) <= (((usqInt) stSize)))) { /* begin subscript:with:storing:format: */ VM_LABEL(2subscriptwithstoringformat); Modified: branches/Cog/src/vm/cointerpmt.h =================================================================== --- branches/Cog/src/vm/cointerpmt.h 2012-04-13 18:28:27 UTC (rev 2549) +++ branches/Cog/src/vm/cointerpmt.h 2012-04-18 06:14:23 UTC (rev 2550) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.156 uuid: f03602f8-cb8a-4ae7-9a2e-921b5b77cf01 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc */ Modified: branches/Cog/src/vm/gcc3x-cointerp.c =================================================================== --- branches/Cog/src/vm/gcc3x-cointerp.c 2012-04-13 18:28:27 UTC (rev 2549) +++ branches/Cog/src/vm/gcc3x-cointerp.c 2012-04-18 06:14:23 UTC (rev 2550) @@ -2,11 +2,11 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.156 uuid: f03602f8-cb8a-4ae7-9a2e-921b5b77cf01 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc from - CoInterpreter VMMaker.oscog-eem.156 uuid: f03602f8-cb8a-4ae7-9a2e-921b5b77cf01 + CoInterpreter VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc */ -static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.156 uuid: f03602f8-cb8a-4ae7-9a2e-921b5b77cf01 " __DATE__ ; +static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -1909,7 +1909,7 @@ /* 575 */ (void (*)(void))0, 0 }; static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void); -const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.156]"; +const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.157]"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */; volatile int sendTrace; @@ -7764,8 +7764,11 @@ goto l93; } else { - result = (((byteAt((rcvr + BaseHeaderSize) + (((index >> 1)) - 1))) << 1) | 1); - goto l93; + if ((fmt < 12) + || (((index >> 1)) >= ((((literalCountOf(rcvr)) + LiteralStart) * BytesPerWord) + 1))) { + result = (((byteAt((rcvr + BaseHeaderSize) + (((index >> 1)) - 1))) << 1) | 1); + goto l93; + } } } /* begin primitiveFailFor: */ @@ -7875,25 +7878,25 @@ goto l96; } if (fmt >= 16) { - - /* Note fmt >= 16 is an artificial flag for strings */ - - valToPut = asciiOfCharacter(value); - if (!(!GIV(primFailCode))) { + if (!(isinstanceOfcompactClassIndex(value, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassCharacter << ShiftForWord)), 0))) { + GIV(primFailCode) = PrimErrBadArgument; goto l96; } + valToPut = longAt((value + BaseHeaderSize) + (CharacterValueIndex << ShiftForWord)); } else { + if ((fmt >= 12) + && (((index >> 1)) < ((((literalCountOf(rcvr)) + LiteralStart) * BytesPerWord) + 1))) { + GIV(primFailCode) = PrimErrBadIndex; + goto l96; + } valToPut = value; } if ((valToPut & 1)) { valToPut = (valToPut >> 1); if (!((valToPut >= 0) && (valToPut <= 255))) { - /* begin primitiveFail */ - if (!GIV(primFailCode)) { - GIV(primFailCode) = 1; - } + GIV(primFailCode) = PrimErrBadArgument; goto l96; } byteAtput((rcvr + BaseHeaderSize) + (((index >> 1)) - 1), valToPut); @@ -12561,25 +12564,25 @@ goto l1; } if (fmt >= 16) { - - /* Note fmt >= 16 is an artificial flag for strings */ - - valToPut = asciiOfCharacter(value); - if (!(!GIV(primFailCode))) { + if (!(isinstanceOfcompactClassIndex(value, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassCharacter << ShiftForWord)), 0))) { + GIV(primFailCode) = PrimErrBadArgument; goto l1; } + valToPut = longAt((value + BaseHeaderSize) + (CharacterValueIndex << ShiftForWord)); } else { + if ((fmt >= 12) + && (index < ((((literalCountOf(rcvr)) + LiteralStart) * BytesPerWord) + 1))) { + GIV(primFailCode) = PrimErrBadIndex; + goto l1; + } valToPut = value; } if ((valToPut & 1)) { valToPut = (valToPut >> 1); if (!((valToPut >= 0) && (valToPut <= 255))) { - /* begin primitiveFail */ - if (!GIV(primFailCode)) { - GIV(primFailCode) = 1; - } + GIV(primFailCode) = PrimErrBadArgument; goto l1; } byteAtput((rcvr + BaseHeaderSize) + (index - 1), valToPut); @@ -12697,8 +12700,11 @@ goto l1; } else { - result = (((byteAt((rcvr + BaseHeaderSize) + (index - 1))) << 1) | 1); - goto l1; + if ((fmt < 12) + || (index >= ((((literalCountOf(rcvr)) + LiteralStart) * BytesPerWord) + 1))) { + result = (((byteAt((rcvr + BaseHeaderSize) + (index - 1))) << 1) | 1); + goto l1; + } } } /* begin primitiveFailFor: */ @@ -43252,7 +43258,9 @@ else { stSize = totalLength - fixedFields; } - if (((((usqInt) index)) >= (((usqInt) 1))) + if ((oopisGreaterThanOrEqualTo(index, (fmt >= 12 + ? (((literalCountOfHeader(headerOf(array))) + LiteralStart) * BytesPerWord) + 1 + : 1))) && ((((usqInt) index)) <= (((usqInt) stSize)))) { /* begin subscript:with:format: */ if (fmt <= 4) { @@ -43370,7 +43378,9 @@ else { stSize = totalLength - fixedFields; } - if (((((usqInt) index)) >= (((usqInt) 1))) + if ((oopisGreaterThanOrEqualTo(index, (fmt >= 12 + ? (((literalCountOfHeader(headerOf(array))) + LiteralStart) * BytesPerWord) + 1 + : 1))) && ((((usqInt) index)) <= (((usqInt) stSize)))) { /* begin subscript:with:storing:format: */ VM_LABEL(2subscriptwithstoringformat); Modified: branches/Cog/src/vm/gcc3x-cointerpmt.c =================================================================== --- branches/Cog/src/vm/gcc3x-cointerpmt.c 2012-04-13 18:28:27 UTC (rev 2549) +++ branches/Cog/src/vm/gcc3x-cointerpmt.c 2012-04-18 06:14:23 UTC (rev 2550) @@ -2,11 +2,11 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.156 uuid: f03602f8-cb8a-4ae7-9a2e-921b5b77cf01 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc from - CoInterpreterMT VMMaker.oscog-eem.156 uuid: f03602f8-cb8a-4ae7-9a2e-921b5b77cf01 + CoInterpreterMT VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc */ -static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.156 uuid: f03602f8-cb8a-4ae7-9a2e-921b5b77cf01 " __DATE__ ; +static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -2008,7 +2008,7 @@ /* 575 */ (void (*)(void))0, 0 }; static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void); -const char *interpreterVersion = "Croquet Closure Cog MT VM [CoInterpreterMT VMMaker.oscog-eem.156]"; +const char *interpreterVersion = "Croquet Closure Cog MT VM [CoInterpreterMT VMMaker.oscog-eem.157]"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */; volatile int sendTrace; sqInt willNotThreadWarnCount; @@ -7865,8 +7865,11 @@ goto l93; } else { - result = (((byteAt((rcvr + BaseHeaderSize) + (((index >> 1)) - 1))) << 1) | 1); - goto l93; + if ((fmt < 12) + || (((index >> 1)) >= ((((literalCountOf(rcvr)) + LiteralStart) * BytesPerWord) + 1))) { + result = (((byteAt((rcvr + BaseHeaderSize) + (((index >> 1)) - 1))) << 1) | 1); + goto l93; + } } } /* begin primitiveFailFor: */ @@ -7976,25 +7979,25 @@ goto l96; } if (fmt >= 16) { - - /* Note fmt >= 16 is an artificial flag for strings */ - - valToPut = asciiOfCharacter(value); - if (!(!GIV(primFailCode))) { + if (!(isinstanceOfcompactClassIndex(value, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassCharacter << ShiftForWord)), 0))) { + GIV(primFailCode) = PrimErrBadArgument; goto l96; } + valToPut = longAt((value + BaseHeaderSize) + (CharacterValueIndex << ShiftForWord)); } else { + if ((fmt >= 12) + && (((index >> 1)) < ((((literalCountOf(rcvr)) + LiteralStart) * BytesPerWord) + 1))) { + GIV(primFailCode) = PrimErrBadIndex; + goto l96; + } valToPut = value; } if ((valToPut & 1)) { valToPut = (valToPut >> 1); if (!((valToPut >= 0) && (valToPut <= 255))) { - /* begin primitiveFail */ - if (!GIV(primFailCode)) { - GIV(primFailCode) = 1; - } + GIV(primFailCode) = PrimErrBadArgument; goto l96; } byteAtput((rcvr + BaseHeaderSize) + (((index >> 1)) - 1), valToPut); @@ -12967,25 +12970,25 @@ goto l1; } if (fmt >= 16) { - - /* Note fmt >= 16 is an artificial flag for strings */ - - valToPut = asciiOfCharacter(value); - if (!(!GIV(primFailCode))) { + if (!(isinstanceOfcompactClassIndex(value, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassCharacter << ShiftForWord)), 0))) { + GIV(primFailCode) = PrimErrBadArgument; goto l1; } + valToPut = longAt((value + BaseHeaderSize) + (CharacterValueIndex << ShiftForWord)); } else { + if ((fmt >= 12) + && (index < ((((literalCountOf(rcvr)) + LiteralStart) * BytesPerWord) + 1))) { + GIV(primFailCode) = PrimErrBadIndex; + goto l1; + } valToPut = value; } if ((valToPut & 1)) { valToPut = (valToPut >> 1); if (!((valToPut >= 0) && (valToPut <= 255))) { - /* begin primitiveFail */ - if (!GIV(primFailCode)) { - GIV(primFailCode) = 1; - } + GIV(primFailCode) = PrimErrBadArgument; goto l1; } byteAtput((rcvr + BaseHeaderSize) + (index - 1), valToPut); @@ -13103,8 +13106,11 @@ goto l1; } else { - result = (((byteAt((rcvr + BaseHeaderSize) + (index - 1))) << 1) | 1); - goto l1; + if ((fmt < 12) + || (index >= ((((literalCountOf(rcvr)) + LiteralStart) * BytesPerWord) + 1))) { + result = (((byteAt((rcvr + BaseHeaderSize) + (index - 1))) << 1) | 1); + goto l1; + } } } /* begin primitiveFailFor: */ @@ -44749,7 +44755,9 @@ else { stSize = totalLength - fixedFields; } - if (((((usqInt) index)) >= (((usqInt) 1))) + if ((oopisGreaterThanOrEqualTo(index, (fmt >= 12 + ? (((literalCountOfHeader(headerOf(array))) + LiteralStart) * BytesPerWord) + 1 + : 1))) && ((((usqInt) index)) <= (((usqInt) stSize)))) { /* begin subscript:with:format: */ if (fmt <= 4) { @@ -44867,7 +44875,9 @@ else { stSize = totalLength - fixedFields; } - if (((((usqInt) index)) >= (((usqInt) 1))) + if ((oopisGreaterThanOrEqualTo(index, (fmt >= 12 + ? (((literalCountOfHeader(headerOf(array))) + LiteralStart) * BytesPerWord) + 1 + : 1))) && ((((usqInt) index)) <= (((usqInt) stSize)))) { /* begin subscript:with:storing:format: */ VM_LABEL(2subscriptwithstoringformat); Modified: branches/Cog/src/vm/interp.h =================================================================== --- branches/Cog/src/vm/interp.h 2012-04-13 18:28:27 UTC (rev 2549) +++ branches/Cog/src/vm/interp.h 2012-04-18 06:14:23 UTC (rev 2550) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.156 uuid: f03602f8-cb8a-4ae7-9a2e-921b5b77cf01 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc */ #define VM_PROXY_MAJOR 1 Modified: branches/Cog/src/vm/vmCallback.h =================================================================== --- branches/Cog/src/vm/vmCallback.h 2012-04-13 18:28:27 UTC (rev 2549) +++ branches/Cog/src/vm/vmCallback.h 2012-04-18 06:14:23 UTC (rev 2550) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.156 uuid: f03602f8-cb8a-4ae7-9a2e-921b5b77cf01 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc */ #define VM_CALLBACK_INC 1 |
Free forum by Nabble | Edit this page |