aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/gofrontend/export.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2019-07-18 05:05:20 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2019-07-18 05:05:20 +0000
commitb94b6cc0251d4775ac15f43885ed63279edb9581 (patch)
tree78a43dec78687c8bcbf4274e222fa17e7bef9464 /gcc/go/gofrontend/export.h
parentdea78431676f0104f5467788e8e78fc05c3ab981 (diff)
downloadgcc-b94b6cc0251d4775ac15f43885ed63279edb9581.zip
gcc-b94b6cc0251d4775ac15f43885ed63279edb9581.tar.gz
gcc-b94b6cc0251d4775ac15f43885ed63279edb9581.tar.bz2
compiler: fix bug in handling of unordered set during exporting
In CL 183850 a change was made to combine tracking/discovery of exported types and imported packages during export data generation. As a result of this refactoring a bug was introduced: the new code can potentially insert items into the exports set (an unordered_set) while iterating through the same set, which is illegal according to the spec for std::unordered_set. This patch fixes the problem by changing the type discovery phase to iterate through a separate list of sorted exports, as opposed to iterating through the main unordered set. Also included is a change to fix the code that looks for variables that are referenced from inlined routine bodies (this code wasn't scanning all of the function that it needed to scan). New test case for this problem in CL 186697. Updates golang/go#33020. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/185977 From-SVN: r273564
Diffstat (limited to 'gcc/go/gofrontend/export.h')
-rw-r--r--gcc/go/gofrontend/export.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/export.h b/gcc/go/gofrontend/export.h
index 1af386c1..c93bced 100644
--- a/gcc/go/gofrontend/export.h
+++ b/gcc/go/gofrontend/export.h
@@ -158,7 +158,8 @@ class Export : public String_dump
const std::map<std::string, Package*>& imports,
const std::string& import_init_fn,
const Import_init_set& imported_init_fns,
- const Bindings* bindings);
+ const Bindings* bindings,
+ Unordered_set(Named_object*)* marked_inline_functions);
// Record a type that is mentioned in export data. Return value is
// TRUE for newly visited types, FALSE for types that have been seen