xref: /onnv-gate/usr/src/cmd/dtrace/test/tst/common/funcs/err.badalloca2.d (revision 2922:42a733b126fb)
1*2922Sdp /*
2*2922Sdp  * CDDL HEADER START
3*2922Sdp  *
4*2922Sdp  * The contents of this file are subject to the terms of the
5*2922Sdp  * Common Development and Distribution License (the "License").
6*2922Sdp  * You may not use this file except in compliance with the License.
7*2922Sdp  *
8*2922Sdp  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*2922Sdp  * or http://www.opensolaris.org/os/licensing.
10*2922Sdp  * See the License for the specific language governing permissions
11*2922Sdp  * and limitations under the License.
12*2922Sdp  *
13*2922Sdp  * When distributing Covered Code, include this CDDL HEADER in each
14*2922Sdp  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*2922Sdp  * If applicable, add the following below this CDDL HEADER, with the
16*2922Sdp  * fields enclosed by brackets "[]" replaced with your own identifying
17*2922Sdp  * information: Portions Copyright [yyyy] [name of copyright owner]
18*2922Sdp  *
19*2922Sdp  * CDDL HEADER END
20*2922Sdp  */
21*2922Sdp 
22*2922Sdp /*
23*2922Sdp  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24*2922Sdp  * Use is subject to license terms.
25*2922Sdp  */
26*2922Sdp 
27*2922Sdp #pragma	ident	"%Z%%M%	%I%	%E% SMI"
28*2922Sdp 
29*2922Sdp 
30*2922Sdp /*
31*2922Sdp  * ASSERTION:
32*2922Sdp  *	alloca() cannot be used to "unconsume" scratch space memory by
33*2922Sdp  *	accepting a negative offset.
34*2922Sdp  *
35*2922Sdp  * SECTION: Actions and Subroutines/alloca()
36*2922Sdp  *
37*2922Sdp  */
38*2922Sdp 
39*2922Sdp BEGIN
40*2922Sdp {
41*2922Sdp 	ptr = alloca(10);
42*2922Sdp 	ptr = alloca(0xffffffffffffffff);
43*2922Sdp 	exit(0);
44*2922Sdp }
45*2922Sdp 
46*2922Sdp ERROR
47*2922Sdp {
48*2922Sdp 	exit(1);
49*2922Sdp }
50