Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: compiler crash when compiling for iOS #1441

Merged
merged 1 commit into from
Aug 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions compiler/mir/mirgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,12 @@ proc genMagic(c: var TCtx, n: PNode; m: TMagic) =
c.emitOperandTree it, sink=true
else:
genCall(c, n)
of mSizeOf, mAlignOf:
# a late-resolved sizeof/alignof. Both have two variants, and they're
# normalized here
c.buildMagicCall m, rtyp:
# skip the surrounding typedesc
c.emitByVal typeLit(c.typeToMir(n[1].typ.skipTypes({tyTypeDesc})))

# arithmetic operations:
of mAddI, mSubI, mMulI, mDivI, mModI, mPred, mSucc:
Expand Down Expand Up @@ -1134,14 +1140,6 @@ proc genMagic(c: var TCtx, n: PNode; m: TMagic) =

else:
genCall(c, n)
of mAlignOf:
# instances of the magic inserted by ``liftdestructors`` and ``alignof(x)``
# calls where ``x`` is of an imported type with unknown alignment reach
# here. The code-generators only care about the types in both cases, so
# that's what we emit
c.buildMagicCall m, rtyp:
# skip the surrounding typedesc
c.emitByVal typeLit(c.typeToMir(n[1].typ.skipTypes({tyTypeDesc})))
of mGetTypeInfoV2:
if n[0].typ == nil:
# the compiler-generated version always uses a type as the argument
Expand Down
Loading