]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
memory: guard indirect autoconfig RAM allocation
authorStefan Reinauer <stefan.reinauer@coreboot.org>
Sun, 17 May 2026 16:28:47 +0000 (09:28 -0700)
committerStefan Reinauer <stefan.reinauer@coreboot.org>
Tue, 2 Jun 2026 23:49:18 +0000 (16:49 -0700)
mapped_malloc() uses labels starting with "*" for indirect allocations.
Those allocations require a fixed start address.

Only enter that path when the caller opted in with canbang. This keeps
ordinary mappings from following that path because of label text alone.

memory.cpp

index 6d3d038f656e89a3df11e73a577e6851b467cd93..bb4b61ec4b5801cb51543128bdd9cf6b5c5b469f 100644 (file)
@@ -2332,7 +2332,7 @@ bool mapped_malloc (addrbank *ab)
        ab->baseaddr_direct_w = NULL;
        ab->flags &= ~ABFLAG_MAPPED;
 
-       if (ab->label && ab->label[0] == '*') {
+       if (canbang && ab->label && ab->label[0] == '*') {
                if (ab->start == 0 || ab->start == 0xffffffff) {
                        write_log(_T("mapped_malloc(*) without start address!\n"));
                        return false;