summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/FormatToken.h
diff options
context:
space:
mode:
authorKrasimir Georgiev <krasimir@google.com>2017-07-05 12:24:01 +0000
committerKrasimir Georgiev <krasimir@google.com>2017-07-05 12:24:01 +0000
commit835ac9bc62fdea9e9a35861b1a5c95a63f340c19 (patch)
tree89354ad231d25a2247d14b66beaedc84b494e305 /clang/lib/Format/FormatToken.h
parent805e9cb3fc18771b2bf57cfd254b6b113c8e9a00 (diff)
downloadbcm5719-llvm-835ac9bc62fdea9e9a35861b1a5c95a63f340c19.tar.gz
bcm5719-llvm-835ac9bc62fdea9e9a35861b1a5c95a63f340c19.zip
[clang-format] Fix an uninitialized memory access
llvm-svn: 307147
Diffstat (limited to 'clang/lib/Format/FormatToken.h')
-rw-r--r--clang/lib/Format/FormatToken.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/clang/lib/Format/FormatToken.h b/clang/lib/Format/FormatToken.h
index 4ea81baf59d..00a0abd64bd 100644
--- a/clang/lib/Format/FormatToken.h
+++ b/clang/lib/Format/FormatToken.h
@@ -646,13 +646,6 @@ struct AdditionalKeywords {
kw_var = &IdentTable.get("var");
kw_yield = &IdentTable.get("yield");
- JsExtraKeywords = std::unordered_set<IdentifierInfo *>(
- {kw_as, kw_async, kw_await, kw_declare, kw_finally, kw_from,
- kw_function, kw_get, kw_import, kw_is, kw_let, kw_module, kw_set,
- kw_type, kw_var, kw_yield,
- // Keywords from the Java section.
- kw_abstract, kw_extends, kw_implements, kw_instanceof, kw_interface});
-
kw_abstract = &IdentTable.get("abstract");
kw_assert = &IdentTable.get("assert");
kw_extends = &IdentTable.get("extends");
@@ -680,6 +673,15 @@ struct AdditionalKeywords {
kw_qsignals = &IdentTable.get("Q_SIGNALS");
kw_slots = &IdentTable.get("slots");
kw_qslots = &IdentTable.get("Q_SLOTS");
+
+ // Keep this at the end of the constructor to make sure everything here is
+ // already initialized.
+ JsExtraKeywords = std::unordered_set<IdentifierInfo *>(
+ {kw_as, kw_async, kw_await, kw_declare, kw_finally, kw_from,
+ kw_function, kw_get, kw_import, kw_is, kw_let, kw_module, kw_set,
+ kw_type, kw_var, kw_yield,
+ // Keywords from the Java section.
+ kw_abstract, kw_extends, kw_implements, kw_instanceof, kw_interface});
}
// Context sensitive keywords.
OpenPOWER on IntegriCloud