Fixed StoreToAddress always writing 32 bits and throwing an error (bug 5248, r=asherkin).

This commit is contained in:
Michael Busby 2012-03-11 18:07:24 -05:00
parent 8fcd0478a1
commit 1d666b09e2

View File

@ -730,10 +730,13 @@ static cell_t StoreToAddress(IPluginContext *pContext, const cell_t *params)
{
case NumberType_Int8:
*reinterpret_cast<uint8_t*>(addr) = data;
break;
case NumberType_Int16:
*reinterpret_cast<uint16_t*>(addr) = data;
break;
case NumberType_Int32:
*reinterpret_cast<uint32_t*>(addr) = data;
break;
default:
pContext->ThrowNativeError("Invalid number types %d", size);
}