Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. JScript.Net compiler bug

JScript.Net compiler bug

Scheduled Pinned Locked Moved Web Development
helpcsharpdotnetwpfwcf
3 Posts 2 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Ben Burnett
    wrote on last edited by
    #1

    So I think I’ve discovered a bug in the JScript.Net compiler. It has to do with the VBArray object and it’s use in derived class' constructor; specifically when initializing the base class. I’ve taken a brief look into the compilers’ source code, but the problem isn’t just popping out at me, so further exploration into this will be necessary. The following code demonstrates the bug.

    class BaseClass {

    private var a\_ : Array;
    
    public function BaseClass ( a : Array ) {
    
        this.a\_ = a;
    
    }   
    

    }

    class DerivedClass extends BaseClass {

    public function DerivedClass ( a : VBArray ) {
    
        super ( **a.toArray ()** ); // compiler chokes here
    
    }
    

    }

    Here's a dump of the error, if anyone's interested. It looks like it got a problem with creating a local variable (why?), but that's just a guess at this point.

    ***INTERNAL COMPILER ERROR***
    Microsoft.Vsa.VsaException: InternalCompilerError (0x80133021): System.ArgumentNullException: Value cannot be null.
    Parameter name: local
    at System.Reflection.Emit.ILGenerator.Emit(OpCode opcode, LocalBuilder local)
    at Microsoft.JScript.Member.TranslateToLateBinding(ILGenerator il, Boolean speculativeEarlyBindingsExist)
    at Microsoft.JScript.Binding.TranslateToIL(ILGenerator il, Type rtype, Boolean preSet, Boolean preSetPlusGet, Boolean calledFromDelete)
    at Microsoft.JScript.Binding.TranslateToIL(ILGenerator il, Type rtype)
    at Microsoft.JScript.Member.TranslateToILWithDupOfThisOb(ILGenerator il)
    at Microsoft.JScript.Binding.TranslateToILCall(ILGenerator il, Type rtype, ASTList argList, Boolean construct, Boolean brackets)
    at Microsoft.JScript.Call.TranslateToIL(ILGenerator il, Type rtype)
    at Microsoft.JScript.Class.EmitInitialCalls(ILGenerator il, MethodBase supcons, ParameterInfo[] pars, ASTList argAST, Int32 callerParameterCount)
    at Microsoft.JScript.FunctionObject.TranslateToIL(CompilerGlobals compilerGlobals)
    at Microsoft.JScript.FunctionDeclaration.TranslateToILInitializer(ILGenerator il)
    at Microsoft.JScript.Block.TranslateToILInstanceInitializers(ILGenerator il)
    at Microsoft.JScript.Class.TranslateToCOMPlusClass()
    at Microsoft.JScript.Class.TranslateToIL(ILGenerator il, Type rtype)
    at Microsoft.JScript.Block.TranslateToIL(ILGenerator il, Type rtype)
    at Microsoft.JScript.ScriptBlock.TranslateToIL(ILGenerator il, Type rtype)
    at Microsoft.JScript.ScriptBlock.TranslateToI

    D 1 Reply Last reply
    0
    • B Ben Burnett

      So I think I’ve discovered a bug in the JScript.Net compiler. It has to do with the VBArray object and it’s use in derived class' constructor; specifically when initializing the base class. I’ve taken a brief look into the compilers’ source code, but the problem isn’t just popping out at me, so further exploration into this will be necessary. The following code demonstrates the bug.

      class BaseClass {

      private var a\_ : Array;
      
      public function BaseClass ( a : Array ) {
      
          this.a\_ = a;
      
      }   
      

      }

      class DerivedClass extends BaseClass {

      public function DerivedClass ( a : VBArray ) {
      
          super ( **a.toArray ()** ); // compiler chokes here
      
      }
      

      }

      Here's a dump of the error, if anyone's interested. It looks like it got a problem with creating a local variable (why?), but that's just a guess at this point.

      ***INTERNAL COMPILER ERROR***
      Microsoft.Vsa.VsaException: InternalCompilerError (0x80133021): System.ArgumentNullException: Value cannot be null.
      Parameter name: local
      at System.Reflection.Emit.ILGenerator.Emit(OpCode opcode, LocalBuilder local)
      at Microsoft.JScript.Member.TranslateToLateBinding(ILGenerator il, Boolean speculativeEarlyBindingsExist)
      at Microsoft.JScript.Binding.TranslateToIL(ILGenerator il, Type rtype, Boolean preSet, Boolean preSetPlusGet, Boolean calledFromDelete)
      at Microsoft.JScript.Binding.TranslateToIL(ILGenerator il, Type rtype)
      at Microsoft.JScript.Member.TranslateToILWithDupOfThisOb(ILGenerator il)
      at Microsoft.JScript.Binding.TranslateToILCall(ILGenerator il, Type rtype, ASTList argList, Boolean construct, Boolean brackets)
      at Microsoft.JScript.Call.TranslateToIL(ILGenerator il, Type rtype)
      at Microsoft.JScript.Class.EmitInitialCalls(ILGenerator il, MethodBase supcons, ParameterInfo[] pars, ASTList argAST, Int32 callerParameterCount)
      at Microsoft.JScript.FunctionObject.TranslateToIL(CompilerGlobals compilerGlobals)
      at Microsoft.JScript.FunctionDeclaration.TranslateToILInitializer(ILGenerator il)
      at Microsoft.JScript.Block.TranslateToILInstanceInitializers(ILGenerator il)
      at Microsoft.JScript.Class.TranslateToCOMPlusClass()
      at Microsoft.JScript.Class.TranslateToIL(ILGenerator il, Type rtype)
      at Microsoft.JScript.Block.TranslateToIL(ILGenerator il, Type rtype)
      at Microsoft.JScript.ScriptBlock.TranslateToIL(ILGenerator il, Type rtype)
      at Microsoft.JScript.ScriptBlock.TranslateToI

      D Offline
      D Offline
      di v inci
      wrote on last edited by
      #2

      you ever figure this one out?

      B 1 Reply Last reply
      0
      • D di v inci

        you ever figure this one out?

        B Offline
        B Offline
        Ben Burnett
        wrote on last edited by
        #3

        No, I never really looked into it any further.

        Regards, -B "[F]reedom isn't a licence, it's responsibility." [David Gerrold, Author's Note in "The Man Who Folded Himself", 2003, p. 119]

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups