diff options
| author | Jim Lawson | 2017-02-03 09:07:10 -0800 |
|---|---|---|
| committer | GitHub | 2017-02-03 09:07:10 -0800 |
| commit | 41ed27574cf871f48d4c4ddfed5285b9853b41d3 (patch) | |
| tree | 3a57e837bfeffb18064c80a55fbc54180f9001a9 /chiselFrontend/src/main/scala/chisel3 | |
| parent | dd51b917566e6b30c3f123ca22a0393e73c2afe8 (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.scala | 4 |
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) } } } |
