- Use a union, rather than pointer aliasing, to access the parts of a VM instruction.
SVN r1922 (scripting)
This commit is contained in:
parent
c424c61ffc
commit
e5ef25591d
10 changed files with 171 additions and 154 deletions
|
|
@ -94,11 +94,11 @@ void FState::SetAction(PSymbolActionFunction *func, bool setdefaultparams)
|
|||
|
||||
// Create a function for this state.
|
||||
VMScriptFunction *vmfunc = new VMScriptFunction;
|
||||
VM_UBYTE *code = vmfunc->AllocCode(sizeof(codetemplate)/VM_OPSIZE);
|
||||
VMOP *code = vmfunc->AllocCode(sizeof(codetemplate)/sizeof(VMOP));
|
||||
memcpy(code, codetemplate, sizeof(codetemplate));
|
||||
FVoidObj *konsta = vmfunc->AllocKonstA(2);
|
||||
VM_ATAG *atag = vmfunc->KonstATags();
|
||||
konsta[0].v = func->Function;
|
||||
konsta[0].v = (void *)func->Function;
|
||||
konsta[1].o = callfunc;
|
||||
atag[0] = ATAG_GENERIC;
|
||||
atag[1] = ATAG_OBJECT;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue