]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm-project/compiler-rt/lib/builtins/i386/chkstk.S
Fix a memory leak in if_delgroups() introduced in r334118.
[FreeBSD/FreeBSD.git] / contrib / llvm-project / compiler-rt / lib / builtins / i386 / chkstk.S
1 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
2 // See https://llvm.org/LICENSE.txt for license information.
3 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
5 #include "../assembly.h"
6
7 // _chkstk routine
8 // This routine is windows specific
9 // http://msdn.microsoft.com/en-us/library/ms648426.aspx
10
11 #ifdef __i386__
12
13 .text
14 .balign 4
15 DEFINE_COMPILERRT_FUNCTION(__chkstk_ms)
16         push   %ecx
17         push   %eax
18         cmp    $0x1000,%eax
19         lea    12(%esp),%ecx
20         jb     1f
21 2:
22         sub    $0x1000,%ecx
23         test   %ecx,(%ecx)
24         sub    $0x1000,%eax
25         cmp    $0x1000,%eax
26         ja     2b
27 1:
28         sub    %eax,%ecx
29         test   %ecx,(%ecx)
30         pop    %eax
31         pop    %ecx
32         ret
33 END_COMPILERRT_FUNCTION(__chkstk_ms)
34
35 #endif // __i386__