Commit Graph

27 Commits

Author SHA1 Message Date
Zack Middleton 75ae9119e6 Fix passing arguments to VM dylib on Apple M1
The engine function pointer to vmMain used variadic arguments but
the vmMain function in the dylib has explicit arguments. Evidently
the arguments are stored on the stack and/or registers differently.

Found by fretn.
2021-11-19 14:54:59 -05:00
ec- 566fb0edfc Allow unaligned load/store in QVM interpreter/x86 compiler
constructions like (dataMask & ~3) was used to protect against out-of-bound load/store when address is 4-byte closer to dataMask
 but at the same time it effectively cut low address bits for ALL load/store operations which is totally wrong in terms of conformance to ALLOWED (i.e. generated by q3lcc from C sources) low-level operations like packed binary data parsing
2017-05-25 09:44:18 +01:00
Zack Middleton c5af65fe5f Fix passing arg9 (qvm only), arg10, and arg11 to vmMain for native libs and non-i386 compiled or interpated qvms. (Currently they aren't use in vmMain in game, cgame, or ui.)
Fix passing args[11] to args[15] from vm to engine on ppc64 and sparc64. Some of the args are used by game bot prediction syscalls. May have been causing bugs. Note: This was fixed for x86_64 in r2163.
2012-12-15 21:55:07 +00:00
Zack Middleton f3e7012bdb REFACTOR [a vs an]
From /dev/humancontroller.
2012-06-18 16:31:16 +00:00
Thilo Schulz 83522282f1 Various fixes to vm_interpreted.c:
- Add opStack protection
- Fix dataMask check for OP_BLOCK_COPY
- Add instruction number check for conditional jumps
- Make errors in VM_PrepareInterpreter nonfatal
2011-06-16 01:11:45 +00:00
Thilo Schulz 9219cde4e8 - Small change to search path order - local files not in .pk3s take precedence over files in pk3s. Should make life easier for modders/mappers wanting to override textures that are already contained in some older pk3
- Make VM loading more robust, change loading order: when vm_* == 0 first try loading DLL, then QVM in *each* search directory/path
- Fix FS_FileForHandle that would return a FILE pointer to invalid file handle 0
2011-06-15 22:09:26 +00:00
Thilo Schulz c174143dc2 - Add x86_64 support to vm_x86.c
- Fix warning on mingw64
2011-06-01 15:17:18 +00:00
Thilo Schulz 61d6e6eb68 Use scaled indexing mode n=4 for addressing opStack, this way we can use the 8 bit offset value in %%bl to address an OPSTACK_SIZE of 1024 which was the old value. 2011-05-18 00:17:02 +00:00
Thilo Schulz c7a68bf283 - Set default opStack size to 256
- Fix integer wraparound. opStack offset in rbx will always be >= 0
2011-05-16 18:17:01 +00:00
Thilo Schulz 017bc7e5da - Add vm_x86.c optimization patch by Eugene C.
- Remove ASM syntax specific code (AT&T vs MASM) for OP_CALL and replace with machine code
2011-05-15 13:15:14 +00:00
Thilo Schulz a7ea395bd0 Add opStack protection to defend against malicious QVMs 2011-05-10 09:14:49 +00:00
Thilo Schulz 2b52867b74 Code cleanup patch by devhc 2011-02-08 18:19:31 +00:00
Ludwig Nussel 469c986640 more security checks in interpreter (#4249) 2009-11-01 19:58:07 +00:00
Ludwig Nussel cc9a74a218 Define stack sizes at central place
also reverts bug 4282 as stack is included in bss already so nothing that needs fixing
2009-11-01 19:58:03 +00:00
Ludwig Nussel 7a5243a3b2 use vm->callLevel to count recursive calls to VM_Call
Throw an error if vm->callLevel is set and VM_Free is called.
2008-03-24 21:20:55 +00:00
Tim Angus 672cfbf16f * Merge unified-sdl to trunk
* Bump Q3_VERSION to 1.35
2007-09-05 18:17:46 +00:00
Ludwig Nussel 4c242115dc - change long to intptr_t for 64bit windows compatability
- change vmMain arguments back to int. 64bit types are apparently not
  needed there. Only the syscall function needs them.
2006-02-18 19:07:23 +00:00
Tim Angus 05e8ab9538 * Added STATUS
* Updated TODO
* Moved ChangeLog to root
* Updated ChangeLog
* s/Foobar/Quake III Arena Source Code/
* Biggest patch EVAR. I wonder how many mail boxes this will fill...
2005-10-29 01:53:09 +00:00
Tim Angus 3a2ad50406 * Moved various source files from their mod sdk locations to places more
appropriate for open source Q3
* This patch looks bigger than it really is, however it will probably break the
  VC and OS X builds (easy to fix though)
2005-10-26 19:45:21 +00:00
Tim Angus 35cb35ff61 * (Non-trivial) fix to the "opStack corrupted in compiled code" bug 2005-10-13 14:47:00 +00:00
Ludwig Nussel d5fbff3f44 revert int->long change as it breaks on 64bit. Actually only
VM_CallInterpreted hurts as VM_CallCompiled is only used on 32bit. Use
same arg types for consistency nevertheless.
2005-09-26 22:23:46 +00:00
Tim Angus cde9e9e93c * Fixed some long/int warnings, hopefully this doesn't disrupt the MSVC and/or 64bit builds 2005-09-26 16:13:14 +00:00
Ludwig Nussel 88171d6bb7 support for 64bit native mods 2005-08-30 20:30:17 +00:00
Ludwig Nussel 5ae70d54b0 remove svn:executable property 2005-08-28 17:54:51 +00:00
Zachary Slater 59cce31e75 newlines fixed 2005-08-26 17:39:27 +00:00
Zachary Slater 5b755058f5 Itsa me, quake3io! 2005-08-26 04:48:05 +00:00
Travis Bradshaw dbe4ddb103 The Quake III Arena sources as originally released under the GPL license on August 20, 2005. 2012-01-31 13:41:34 -06:00