components/ksh93/patches/17851169.patch
author Tomas Klacko <tomas.klacko@oracle.com>
Tue, 25 Mar 2014 10:51:42 +0100
branchs11u1-sru
changeset 3011 9265805e77d5
child 6073 99c2bf34d78a
permissions -rw-r--r--
17851169 ksh93 core dump in sh_assignok() function
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3011
9265805e77d5 17851169 ksh93 core dump in sh_assignok() function
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     1
http://lists.research.att.com/pipermail/ast-developers/2014q1/003809.html
9265805e77d5 17851169 ksh93 core dump in sh_assignok() function
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     2
---
9265805e77d5 17851169 ksh93 core dump in sh_assignok() function
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     3
--- a/src/cmd/ksh93/sh/subshell.c
9265805e77d5 17851169 ksh93 core dump in sh_assignok() function
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     4
+++ b/src/cmd/ksh93/sh/subshell.c
9265805e77d5 17851169 ksh93 core dump in sh_assignok() function
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     5
@@ -234,15 +234,22 @@ Namval_t *sh_assignok(register Namval_t *np,int add)
9265805e77d5 17851169 ksh93 core dump in sh_assignok() function
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     6
 {
9265805e77d5 17851169 ksh93 core dump in sh_assignok() function
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     7
 	register Namval_t	*mp;
9265805e77d5 17851169 ksh93 core dump in sh_assignok() function
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     8
 	register struct Link	*lp;
9265805e77d5 17851169 ksh93 core dump in sh_assignok() function
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     9
-	register struct subshell *sp = (struct subshell*)subshell_data;
9265805e77d5 17851169 ksh93 core dump in sh_assignok() function
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    10
-	Shell_t			*shp = sp->shp;
9265805e77d5 17851169 ksh93 core dump in sh_assignok() function
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    11
-	Dt_t			*dp= shp->var_tree;
9265805e77d5 17851169 ksh93 core dump in sh_assignok() function
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    12
+	register struct subshell *sp;
9265805e77d5 17851169 ksh93 core dump in sh_assignok() function
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    13
+	Shell_t			*shp;
9265805e77d5 17851169 ksh93 core dump in sh_assignok() function
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    14
+	Dt_t			*dp;
9265805e77d5 17851169 ksh93 core dump in sh_assignok() function
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    15
 	Namval_t		*mpnext;
9265805e77d5 17851169 ksh93 core dump in sh_assignok() function
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    16
 	Namarr_t		*ap;
9265805e77d5 17851169 ksh93 core dump in sh_assignok() function
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    17
 	int			save;
9265805e77d5 17851169 ksh93 core dump in sh_assignok() function
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    18
+
9265805e77d5 17851169 ksh93 core dump in sh_assignok() function
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    19
+        sp = (struct subshell*)subshell_data;
9265805e77d5 17851169 ksh93 core dump in sh_assignok() function
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    20
+
9265805e77d5 17851169 ksh93 core dump in sh_assignok() function
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    21
 	/* don't bother with this */
9265805e77d5 17851169 ksh93 core dump in sh_assignok() function
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    22
-	if(!sp->shpwd || np==SH_LEVELNOD || np==L_ARGNOD || np==SH_SUBSCRNOD || np==SH_NAMENOD)
9265805e77d5 17851169 ksh93 core dump in sh_assignok() function
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    23
+	if(!sp || !sp->shpwd || np==SH_LEVELNOD || np==L_ARGNOD || np==SH_SUBSCRNOD || np==SH_NAMENOD)
9265805e77d5 17851169 ksh93 core dump in sh_assignok() function
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    24
 		return(np);
9265805e77d5 17851169 ksh93 core dump in sh_assignok() function
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    25
+
9265805e77d5 17851169 ksh93 core dump in sh_assignok() function
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    26
+	shp = sp->shp;
9265805e77d5 17851169 ksh93 core dump in sh_assignok() function
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    27
+	dp = shp->var_tree;
9265805e77d5 17851169 ksh93 core dump in sh_assignok() function
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    28
+
9265805e77d5 17851169 ksh93 core dump in sh_assignok() function
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    29
 	if((ap=nv_arrayptr(np)) && (mp=nv_opensub(np)))
9265805e77d5 17851169 ksh93 core dump in sh_assignok() function
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    30
 	{
9265805e77d5 17851169 ksh93 core dump in sh_assignok() function
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    31
 		shp->last_root = ap->table;
9265805e77d5 17851169 ksh93 core dump in sh_assignok() function
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    32