From 61c91059b966798928c805746eb64b11fbeab373 Mon Sep 17 00:00:00 2001
From: Philippe Gil <gil@adacore.com>
Date: Fri, 27 Nov 2020 11:14:15 +0100
Subject: [PATCH] [Ada] Fix possible uninitialized ATCB component use

gcc/ada/

	* libgnarl/s-tporft.adb (Register_Foreign_Thread): Set
	Global_Task_Lock_Nesting before using allocator.
---
 gcc/ada/libgnarl/s-tporft.adb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/ada/libgnarl/s-tporft.adb b/gcc/ada/libgnarl/s-tporft.adb
index 9d99eac80c2c..634eae63ea32 100644
--- a/gcc/ada/libgnarl/s-tporft.adb
+++ b/gcc/ada/libgnarl/s-tporft.adb
@@ -53,6 +53,7 @@ begin
 
    Local_ATCB.Common.LL.Thread := Thread;
    Local_ATCB.Common.Current_Priority := System.Priority'First;
+   Local_ATCB.Common.Global_Task_Lock_Nesting := 0;
    Specific.Set (Local_ATCB'Unchecked_Access);
 
    --  It is now safe to use an allocator
-- 
GitLab