duskos

dusk os fork
git clone git://git.alexwennerberg.com/duskos
Log | Files | Refs | README | LICENSE

commit 9f9b24696962dfb85158dc363d96fc0ba4d8476b
parent 0b756a4655726eb38df46f6a0c3921fd2e125a29
Author: Virgil Dupras <hsoft@hardcoded.net>
Date:   Wed,  5 Jul 2023 09:33:55 -0400

comp/c: alignment discipline

Diffstat:
Mfs/comp/c/fgen.fs | 4++--
Mfs/comp/c/gen.fs | 2+-
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/comp/c/fgen.fs b/fs/comp/c/fgen.fs @@ -9,7 +9,7 @@ : _postlude _curfunc CDecl :argssize ?dup if ps+, then - _locvars CDecl :size ?dup if rs+, then + _locvars CDecl :size ?dup if align4 rs+, then popret, ; $40 const MAXSWITCHCASES @@ -183,7 +183,7 @@ MAXSWITCHCASES << Stack :new structbind Stack _cases here _curfunc to CDecl offset ( ) _curfunc ?updateFunctionPrototype _curfunc addSymbol \ prelude: space for stack frame. "dup," is wiggle room for W - pushret, dup, _locvars CDecl :size ?dup if neg rs+, then + pushret, dup, _locvars CDecl :size ?dup if align4 neg rs+, then _initcode ?dup if [compile] again r> [compile] then then 0 to _laststmtid parseStatements _laststmtid 1 <> if emitNullRet then \ emit implicit return if needed diff --git a/fs/comp/c/gen.fs b/fs/comp/c/gen.fs @@ -50,4 +50,4 @@ require /sys/scratch.fs ." complete: " dup printtype nl> CDecl offset here over - spit nl> else drop then else parseFunctionProto then - else parseGlobalDecl then ( ) unlockhere ; + else alignhere parseGlobalDecl then ( ) unlockhere ;