summaryrefslogtreecommitdiff
path: root/chiselFrontend/src/main/scala/chisel3
diff options
context:
space:
mode:
authorJim Lawson2017-02-03 09:07:10 -0800
committerGitHub2017-02-03 09:07:10 -0800
commit41ed27574cf871f48d4c4ddfed5285b9853b41d3 (patch)
tree3a57e837bfeffb18064c80a55fbc54180f9001a9 /chiselFrontend/src/main/scala/chisel3
parentdd51b917566e6b30c3f123ca22a0393e73c2afe8 (diff)
Fix potential NPE if we try to evaluate isMissingIOWrapper() inside IO(). (#479)
Diffstat (limited to 'chiselFrontend/src/main/scala/chisel3')
-rw-r--r--chiselFrontend/src/main/scala/chisel3/core/Binding.scala4
1 files changed, 3 insertions, 1 deletions
diff --git a/chiselFrontend/src/main/scala/chisel3/core/Binding.scala b/chiselFrontend/src/main/scala/chisel3/core/Binding.scala
index 71c441a7..a857ae85 100644
--- a/chiselFrontend/src/main/scala/chisel3/core/Binding.scala
+++ b/chiselFrontend/src/main/scala/chisel3/core/Binding.scala
@@ -155,7 +155,9 @@ object Binding {
// we know the wrapper is missing, whether or not the element is a member of io.
// But if it's not an io element, we want to issue the complementary "unbound" error.
// Revisit this when we collect error messages instead of throwing exceptions.
- x.io.flatten.contains(element)
+ // The null test below is due to the fact that we may be evaluating the arguments
+ // of the IO() wrapper itself.
+ (x.io != null) && x.io.flatten.contains(element)
}
}
}