aboutsummaryrefslogtreecommitdiff
path: root/vm/compiler/codegen/CompilerCodegen.h
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2009-10-16 17:25:34 -0700
committerElliott Hughes <enh@google.com>2009-10-19 11:45:17 -0700
commit57ac2250b927cae01dc3858c0fe3b2af9bbec743 (patch)
treec861272f0272c67cc5417da212af489def919614 /vm/compiler/codegen/CompilerCodegen.h
parent51a3164b9d4e1b3277f07afd0bbd4df7740e01c7 (diff)
Improve error handling in InetAddress native code.
Fix a bug where we changed the return values of functions such as byteArrayToSocketAddress without changing the logic in the callers that's supposed to distinguish success and failure. For simplicity, I've switch all of these functions over to returning bool, and I've gone through all the callers to ensure we're using the right check now. (This is the majority of the diff.) Also switch to throwing IllegalArgumentException instead of SocketException when we find ourselves with a bad byte[] --- before we were throwing a checked exception we weren't allowed to (from native code, which can't actually be checked statically) and then trying to cover up in Java. I've also simply removed one case where we were trying to mask an OutOfMemoryError with a SocketException. I also removed dead code in socketAddressToString: this function's sole caller always passed false for withPort. This makes the temporary variable and the copying (which was unsafe) unnecessary. In instances where I was already changing the code, I've removed bogus "handle == 0" failures, but I'll come back and remove all the other instances in another patch. Since I was in connectSocketImpl, I've removed the dead second half of that method.
Diffstat (limited to 'vm/compiler/codegen/CompilerCodegen.h')
0 files changed, 0 insertions, 0 deletions