Skip to content

Is it generally dangerous to inline codes #83192

Answered by teo-tsirpanis
Xyncgas asked this question in General
Discussion options

You must be logged in to vote

Duplicate of dotnet/fsharp#8083. Apparently the localloc instruction requires only the buffer's length to be present on the evaluation stack. The following F# program fails both in Debug and Release.

let foobar () =
    let foo = 1n + NativeInterop.NativePtr.toNativeInt (NativeInterop.NativePtr.stackalloc<byte> 10)
    0
    
[<EntryPoint>]
let main _ = foobar ()

Replies: 4 comments 5 replies

Comment options

You must be logged in to vote
2 replies
@Clockwork-Muse
Comment options

@vzarytovskii
Comment options

Comment options

You must be logged in to vote
1 reply
@vzarytovskii
Comment options

Comment options

You must be logged in to vote
2 replies
@teo-tsirpanis
Comment options

@vzarytovskii
Comment options

Answer selected by teo-tsirpanis
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants