Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dart2js crashes on nullable bools in checked mode #3146

Closed
nex3 opened this issue May 19, 2012 · 5 comments
Closed

dart2js crashes on nullable bools in checked mode #3146

nex3 opened this issue May 19, 2012 · 5 comments

Comments

@nex3
Copy link
Member

nex3 commented May 19, 2012

The following code throws an error when run with enable_type_checks and enable_asserts under frog:

  bool foo(a) => a;

  main() {
    print(foo(null));
  }

This is unexpected, since Dart allows null as a value of bool.

@anders-sandholm
Copy link
Contributor

Removed Area-Frog label.
Added Area-Dart2JS, OldAreaFrog labels.

@anders-sandholm
Copy link
Contributor

Removed OldAreaFrog label.
Added FromAreaFrog label.

@anders-sandholm
Copy link
Contributor

When running the above, I get:

../lib/dart2js/lib/compiler/implementation/lib/js_helper.dart:412:17: Error: The compiler crashed when compiling this element.
  static String objectToString(Object object) {
                ^^^^^^^^^^^^^^
The compiler is broken.

When compiling the above element, the compiler crashed. It is not
possible to tell if this is caused by a problem in your program or
not. Regardless, the compiler should not crash.

The Dart team would greatly appreciate if you would take a moment to
report this problem at http://dartbug.com/new.

Please include the following information:

* the name and version of your operating system,

* the Dart SDK build number (build number could not be determined), and

* the stack trace you see here.

Internal error: NullPointerException : method: 'hashCode'
Receiver: null
Arguments: []
 0. Function: 'Object.noSuchMethod' url: 'bootstrap' line:473 col:137
 1. Function: 'HashMapImplementation._probeForAdding@924b4b8' url: 'bootstrap_impl' line:580 col:6
 2. Function: 'HashMapImplementation.[]=' url: 'bootstrap_impl' line:616 col:69
 3. Function: 'SsaCodeGenerator.sequentializeCopies' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/ssa/codegen.dart' line:1040 col:22
 4. Function: 'SsaCodeGenerator.assignPhisOfSuccessors' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/ssa/codegen.dart' line:1092 col:24
 5. Function: 'SsaCodeGenerator.iterateBasicBlock' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/ssa/codegen.dart' line:1119 col:27
 6. Function: 'SsaCodeGenerator.visitBasicBlock' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/ssa/codegen.dart' line:989 col:22
 7. Function: 'SsaCodeGenerator.visitSubGraph' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/ssa/codegen.dart' line:288 col:20
 8. Function: 'SsaCodeGenerator.visitSubGraphInfo' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/ssa/codegen.dart' line:680 col:18
 9. Function: 'HSubGraphBlockInformation.accept' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/ssa/nodes.dart' line:2379 col:30
 10. Function: 'SsaCodeGenerator.generateStatements' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/ssa/codegen.dart' line:380 col:19
 11. Function: 'SsaCodeGenerator.visitIfInfo' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/ssa/codegen.dart' line:620 col:25
 12. Function: 'HIfBlockInformation.accept' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/ssa/nodes.dart' line:2505 col:24
 13. Function: 'SsaCodeGenerator.handleBlockFlow' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/ssa/codegen.dart' line:962 col:31
 14. Function: 'SsaCodeGenerator.visitBasicBlock' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/ssa/codegen.dart' line:981 col:24
 15. Function: 'SsaCodeGenerator.visitGoto' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/ssa/codegen.dart' line:1261 col:20
 16. Function: 'HGoto.accept' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/ssa/nodes.dart' line:1691 col:48
 17. Function: 'SsaCodeGenerator.visit' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/ssa/codegen.dart' line:577 col:16
 18. Function: 'SsaCodeGenerator.iterateBasicBlock' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/ssa/codegen.dart' line:1123 col:10
 19. Function: 'SsaCodeGenerator.visitBasicBlock' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/ssa/codegen.dart' line:989 col:22
 20. Function: 'SsaCodeGenerator.visitGoto' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/ssa/codegen.dart' line:1261 col:20
 21. Function: 'HGoto.accept' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/ssa/nodes.dart' line:1691 col:48
 22. Function: 'SsaCodeGenerator.visit' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/ssa/codegen.dart' line:577 col:16
 23. Function: 'SsaCodeGenerator.iterateBasicBlock' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/ssa/codegen.dart' line:1123 col:10
 24. Function: 'SsaCodeGenerator.visitBasicBlock' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/ssa/codegen.dart' line:989 col:22
 25. Function: 'SsaCodeGenerator.visitGraph' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/ssa/codegen.dart' line:275 col:20
 26. Function: 'SsaCodeGeneratorTask.function' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/ssa/codegen.dart' line:48 col:25
 27. Function: 'CompilerTask.measure' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/compiler.dart' line:545 col:24
 28. Function: 'SsaCodeGeneratorTask.generateMethod' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/ssa/codegen.dart' line:39 col:19
 29. Function: 'JavaScriptBackend.codegen' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/compiler.dart' line:62 col:36
 30. Function: 'Compiler.codegen' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/compiler.dart' line:414 col:36
 31. Function: 'WorkItem.run' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/compiler.dart' line:19 col:28
 32. Function: 'Compiler.function' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/compiler.dart' line:381 col:54
 33. Function: 'Compiler.withCurrentElement' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/compiler.dart' line:111 col:15
 34. Function: 'Compiler.withCurrentElement' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/compiler.dart' line:116 col:7
 35. Function: 'Compiler.processQueue' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/compiler.dart' line:381 col:25
 36. Function: 'Compiler.runCompiler' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/compiler.dart' line:366 col:17
 37. Function: 'Compiler.run' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/compiler.dart' line:234 col:18
 38. Function: 'Compiler.run' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/compiler.dart' line:235 col:7
 39. Function: 'Compiler.run' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/apiimpl.dart' line:86 col:29
 40. Function: '::compile' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/compiler.dart' line:47 col:15
 41. Function: '::compile' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/dart2js.dart' line:205 col:28
 42. Function: '::compilerMain' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/dart2js.dart' line:254 col:10
 43. Function: '::main' url: 'file:///home/sandholm/dart/dart-sdk/lib/dart2js/lib/compiler/implementation/dart2js.dart' line:334 col:17


Removed FromAreaFrog label.
Changed the title to: "dart2js crashes on nullable bools in checked mode".

@DartBot
Copy link

DartBot commented Jun 12, 2012

This comment was originally written by [email protected]


Set owner to [email protected].
Added Accepted label.

@DartBot
Copy link

DartBot commented Jun 12, 2012

This comment was originally written by [email protected]


This has been fixed on bleeding_edge.


Added Fixed label.

copybara-service bot pushed a commit that referenced this issue Oct 1, 2021
Changes:
```
> git log --format="%C(auto) %h %s" a817863..37d0592
 37d05928 Don't ignore 'packages/' over the root-dir (#3162)
 85e11718 Add in-memory cache to store version listings (#3163)
 46f79d5b Use source.hasMultipleVersions to decide when to show version constraint. (#3159)
 0e553a07 Warn against likely bad env-var name (#3146)
 30580bee Migrate src/git to null-safety (#3158)

```

Change-Id: Ic04937ad0adbeb228770087dedb25ccfcc4f3206
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215202
Reviewed-by: Sarah Zakarias <[email protected]>
Commit-Queue: Sigurd Meldgaard <[email protected]>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants