diff options
| author | Albert Chen | 2020-02-03 15:57:55 -0800 |
|---|---|---|
| committer | GitHub | 2020-02-03 23:57:55 +0000 |
| commit | 9b64b3376b6278b90f746e7dfa3e27ea78c8c3dc (patch) | |
| tree | 40f3ccd53ee55b84229b1ddd5f42185b51c107d2 /src | |
| parent | 45daf945daee584ce2461444aa0c2f89f67b1e21 (diff) | |
Dedup: check if moduleOpt exists before getting (#1323)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/scala/firrtl/transforms/Dedup.scala | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/scala/firrtl/transforms/Dedup.scala b/src/main/scala/firrtl/transforms/Dedup.scala index 179ccbe4..0667a184 100644 --- a/src/main/scala/firrtl/transforms/Dedup.scala +++ b/src/main/scala/firrtl/transforms/Dedup.scala @@ -296,8 +296,10 @@ object DedupModules { val module2Annotations = mutable.HashMap.empty[String, mutable.HashSet[Annotation]] annotations.foreach { a => a.getTargets.foreach { t => - val annos = module2Annotations.getOrElseUpdate(t.moduleOpt.get, mutable.HashSet.empty[Annotation]) - annos += a + if (t.moduleOpt.isDefined) { + val annos = module2Annotations.getOrElseUpdate(t.moduleOpt.get, mutable.HashSet.empty[Annotation]) + annos += a + } } } def fastSerializedHash(s: Statement): Int ={ |
