Bug fix: crash if teams executed on host

Added argv array check/allocation for parallel directly nested inside the teams
construct, as new coming Fortran codegen passes parameters directly into
kmpc_fork_call missing same parameters in kmpc_fork_teams (earlier codegen
passed to parallel the subset of parameter passed to teams, and thus
no check/allocation needed).

Patch by Andrey Churbanov

Differential Revision: http://reviews.llvm.org/D21336

llvm-svn: 272935
This commit is contained in:
Jonathan Peyton 2016-06-16 18:47:38 +00:00
parent 95eeb7730d
commit 7cf08d4299
1 changed files with 1 additions and 0 deletions

View File

@ -1494,6 +1494,7 @@ __kmp_fork_call(
// The team is actual (hot), all workers are ready at the fork barrier.
// No lock needed to initialize the team a bit, then free workers.
parent_team->t.t_ident = loc;
__kmp_alloc_argv_entries( argc, parent_team, TRUE );
parent_team->t.t_argc = argc;
argv = (void**)parent_team->t.t_argv;
for( i=argc-1; i >= 0; --i )