Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Error:(490, 1) Kotlin: [Internal Error] org.jetbrains.kotlin.codegen.CompilationException: Back-end (JVM) Internal error: wrong code generated
- java.lang.NullPointerException null
- bytecode:
- @Lorg/jetbrains/annotations/NotNull;() // invisible, parameter 0
- L0
- LINENUMBER 492 L0
- L1
- LINENUMBER 493 L1
- L2
- INVOKESTATIC kotlin/jvm/internal/$PseudoInsn.FAKE_ALWAYS_FALSE_IFEQ ()I
- IFEQ L3
- L4
- LINENUMBER 494 L4
- NEW java/math/BigDecimal
- DUP
- LDC "1000000"
- INVOKESPECIAL java/math/BigDecimal.<init> (Ljava/lang/String;)V
- ASTORE 3
- L5
- LINENUMBER 495 L5
- LDC 2
- INVOKESTATIC java/math/BigDecimal.valueOf (J)Ljava/math/BigDecimal;
- ALOAD 3
- ICONST_0
- ICONST_2
- ACONST_NULL
- INVOKESTATIC com/deanveloper/mathkt/BigFunctionsKt.pow$default (Ljava/math/BigDecimal;Ljava/math/BigDecimal;IILjava/lang/Object;)Ljava/math/BigDecimal;
- ASTORE 4
- L6
- LINENUMBER 496 L6
- ALOAD 3
- ASTORE 6
- GETSTATIC java/math/BigDecimal.ONE : Ljava/math/BigDecimal;
- DUP
- LDC "BigDecimal.ONE"
- INVOKESTATIC kotlin/jvm/internal/Intrinsics.checkExpressionValueIsNotNull (Ljava/lang/Object;Ljava/lang/String;)V
- ASTORE 7
- NOP
- L7
- ALOAD 6
- ALOAD 7
- INVOKEVIRTUAL java/math/BigDecimal.add (Ljava/math/BigDecimal;)Ljava/math/BigDecimal;
- DUP
- LDC "this.add(other)"
- INVOKESTATIC kotlin/jvm/internal/Intrinsics.checkExpressionValueIsNotNull (Ljava/lang/Object;Ljava/lang/String;)V
- GOTO L8
- L8
- L9
- LINENUMBER 496 L9
- ASTORE 5
- L10
- LINENUMBER 497 L10
- LDC 2
- INVOKESTATIC java/math/BigDecimal.valueOf (J)Ljava/math/BigDecimal;
- ALOAD 5
- ICONST_0
- ICONST_2
- ACONST_NULL
- INVOKESTATIC com/deanveloper/mathkt/BigFunctionsKt.pow$default (Ljava/math/BigDecimal;Ljava/math/BigDecimal;IILjava/lang/Object;)Ljava/math/BigDecimal;
- ASTORE 6
- L11
- LINENUMBER 498 L11
- ALOAD 4
- ASTORE 7
- ALOAD 0
- ALOAD 4
- ILOAD 1
- INVOKEVIRTUAL java/math/BigDecimal.divide (Ljava/math/BigDecimal;I)Ljava/math/BigDecimal;
- DUP
- LDC "this.divide(power, scale)"
- INVOKESTATIC kotlin/jvm/internal/Intrinsics.checkExpressionValueIsNotNull (Ljava/lang/Object;Ljava/lang/String;)V
- ASTORE 8
- NOP
- L12
- ALOAD 7
- ALOAD 8
- INVOKEVIRTUAL java/math/BigDecimal.multiply (Ljava/math/BigDecimal;)Ljava/math/BigDecimal;
- DUP
- LDC "this.multiply(other)"
- INVOKESTATIC kotlin/jvm/internal/Intrinsics.checkExpressionValueIsNotNull (Ljava/lang/Object;Ljava/lang/String;)V
- GOTO L13
- L13
- ASTORE 2
- L3
- LINENUMBER 499 L3
- ALOAD 2
- ALOAD 6
- ASTORE 7
- ALOAD 0
- ALOAD 6
- ILOAD 1
- INVOKEVIRTUAL java/math/BigDecimal.divide (Ljava/math/BigDecimal;I)Ljava/math/BigDecimal;
- DUP
- LDC "this.divide(powerp1, scale)"
- INVOKESTATIC kotlin/jvm/internal/Intrinsics.checkExpressionValueIsNotNull (Ljava/lang/Object;Ljava/lang/String;)V
- ASTORE 8
- INVOKESTATIC kotlin/jvm/internal/InlineMarker.beforeInlineCall ()V
- NOP
- L14
- ALOAD 7
- ALOAD 8
- INVOKEVIRTUAL java/math/BigDecimal.multiply (Ljava/math/BigDecimal;)Ljava/math/BigDecimal;
- DUP
- LDC "this.multiply(other)"
- INVOKESTATIC kotlin/jvm/internal/Intrinsics.checkExpressionValueIsNotNull (Ljava/lang/Object;Ljava/lang/String;)V
- GOTO L15
- L15
- INVOKESTATIC kotlin/jvm/internal/InlineMarker.afterInlineCall ()V
- L16
- LINENUMBER 499 L16
- INVOKEVIRTUAL java/math/BigDecimal.compareTo (Ljava/math/BigDecimal;)I
- IFEQ L2
- L17
- LINENUMBER 501 L17
- ALOAD 2
- ARETURN
- L18
- LOCALVARIABLE powerp1 Ljava/math/BigDecimal; L11 L17 6
- LOCALVARIABLE np1 Ljava/math/BigDecimal; L10 L17 5
- LOCALVARIABLE power Ljava/math/BigDecimal; L6 L17 4
- LOCALVARIABLE n Ljava/math/BigDecimal; L5 L17 3
- LOCALVARIABLE toReturn Ljava/math/BigDecimal; L1 L18 2
- LOCALVARIABLE $receiver Ljava/math/BigDecimal; L0 L18 0
- LOCALVARIABLE scale I L0 L18 1
- MAXSTACK = 5
- MAXLOCALS = 11
- Cause: java.lang.NullPointerException
- File being compiled and position: (490,1) in C:/Users/Deen/Documents/GitHub/MathKt/src/main/kotlin/com/deanveloper/mathkt/BigFunctions.kt
- PsiElement: private fun BigDecimal.asinIterate(scale: Int = defaultScale): BigDecimal {
- // 2^n * sin(x/2^n) as n->Infinity
- var toReturn: BigDecimal
- do {
- val n = BigDecimal("1000000")
- val power = BigDecimal.valueOf(2).pow(n)
- val np1 = n + BigDecimal.ONE
- val powerp1 = BigDecimal.valueOf(2).pow(np1)
- toReturn = power.times(this.divide(power, scale))
- } while (toReturn.compareTo(powerp1.times(this.divide(powerp1, scale))) === 0)
- return toReturn
- }
- The root cause was thrown at: StackTransformationUtils.kt:114
- at org.jetbrains.kotlin.codegen.FunctionCodegen.endVisit(FunctionCodegen.java:526)
- at org.jetbrains.kotlin.codegen.FunctionCodegen.generateMethod(FunctionCodegen.java:225)
- at org.jetbrains.kotlin.codegen.FunctionCodegen.generateMethod(FunctionCodegen.java:145)
- at org.jetbrains.kotlin.codegen.FunctionCodegen.gen(FunctionCodegen.java:120)
- at org.jetbrains.kotlin.codegen.MemberCodegen.genFunctionOrProperty(MemberCodegen.java:181)
- at org.jetbrains.kotlin.codegen.PackagePartCodegen.generateBody(PackagePartCodegen.java:94)
- at org.jetbrains.kotlin.codegen.MemberCodegen.generate(MemberCodegen.java:118)
- at org.jetbrains.kotlin.codegen.PackageCodegen.generateFile(PackageCodegen.java:117)
- at org.jetbrains.kotlin.codegen.PackageCodegen.generate(PackageCodegen.java:61)
- at org.jetbrains.kotlin.codegen.KotlinCodegenFacade.generatePackage(KotlinCodegenFacade.java:99)
- at org.jetbrains.kotlin.codegen.KotlinCodegenFacade.doGenerateFiles(KotlinCodegenFacade.java:77)
- at org.jetbrains.kotlin.codegen.KotlinCodegenFacade.compileCorrectFiles(KotlinCodegenFacade.java:44)
- at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.generate(KotlinToJVMBytecodeCompiler.kt:452)
- at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules(KotlinToJVMBytecodeCompiler.kt:150)
- at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:183)
- at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:52)
- at org.jetbrains.kotlin.cli.common.CLICompiler.exec(CLICompiler.java:199)
- at org.jetbrains.kotlin.cli.common.CLICompiler.exec(CLICompiler.java:154)
- at org.jetbrains.kotlin.cli.common.CLICompiler.execAndOutputXml(CLICompiler.java:73)
- at org.jetbrains.kotlin.daemon.CompileServiceImpl$remoteIncrementalCompile$1.invoke(CompileServiceImpl.kt:247)
- at org.jetbrains.kotlin.daemon.CompileServiceImpl$remoteIncrementalCompile$1.invoke(CompileServiceImpl.kt:70)
- at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$1$1.invoke(CompileServiceImpl.kt:421)
- at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$1$1.invoke(CompileServiceImpl.kt:70)
- at org.jetbrains.kotlin.daemon.common.DummyProfiler.withMeasure(PerfUtils.kt:137)
- at org.jetbrains.kotlin.daemon.CompileServiceImpl.checkedCompile(CompileServiceImpl.kt:454)
- at org.jetbrains.kotlin.daemon.CompileServiceImpl.access$checkedCompile(CompileServiceImpl.kt:70)
- at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$1.invoke(CompileServiceImpl.kt:420)
- at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$1.invoke(CompileServiceImpl.kt:70)
- at org.jetbrains.kotlin.daemon.CompileServiceImpl.ifAlive(CompileServiceImpl.kt:565)
- at org.jetbrains.kotlin.daemon.CompileServiceImpl.ifAlive$default(CompileServiceImpl.kt:504)
- at org.jetbrains.kotlin.daemon.CompileServiceImpl.doCompile(CompileServiceImpl.kt:411)
- at org.jetbrains.kotlin.daemon.CompileServiceImpl.remoteIncrementalCompile(CompileServiceImpl.kt:244)
- at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
- at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
- at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
- at java.lang.reflect.Method.invoke(Method.java:498)
- at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:324)
- at sun.rmi.transport.Transport$1.run(Transport.java:200)
- at sun.rmi.transport.Transport$1.run(Transport.java:197)
- at java.security.AccessController.doPrivileged(Native Method)
- at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
- at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
- at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
- at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)
- at java.security.AccessController.doPrivileged(Native Method)
- at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
- at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
- at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
- at java.lang.Thread.run(Thread.java:745)
- Caused by: java.lang.NullPointerException
- at org.jetbrains.kotlin.codegen.optimization.fixStack.StackTransformationUtilsKt.generateStoreInstructions(StackTransformationUtils.kt:114)
- at org.jetbrains.kotlin.codegen.optimization.fixStack.StackTransformationUtilsKt.saveStack(StackTransformationUtils.kt:71)
- at org.jetbrains.kotlin.codegen.optimization.fixStack.FixStackMethodTransformer$transformBeforeInlineCallMarker$1.invoke(FixStackMethodTransformer.kt:187)
- at org.jetbrains.kotlin.codegen.optimization.fixStack.FixStackMethodTransformer$transformBeforeInlineCallMarker$1.invoke(FixStackMethodTransformer.kt:27)
- at org.jetbrains.kotlin.codegen.optimization.fixStack.FixStackMethodTransformer.transform(FixStackMethodTransformer.kt:53)
- at org.jetbrains.kotlin.codegen.optimization.MandatoryMethodTransformer.transform(MandatoryMethodTransforker.kt:29)
- at org.jetbrains.kotlin.codegen.optimization.OptimizationMethodVisitor.visitEnd(OptimizationMethodVisitor.java:81)
- at org.jetbrains.kotlin.codegen.FunctionCodegen.endVisit(FunctionCodegen.java:519)
- ... 48 more
Advertisement
Add Comment
Please, Sign In to add comment