Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8019476 Issues found by jsfunfuzz
  3. JDK-8020223

ClassCastException: String can not be casted to ScriptFunction

    XMLWordPrintable

Details

    • Sub-task
    • Status: Closed
    • P3
    • Resolution: Fixed
    • 8
    • 8
    • core-libs
    • None
    • b100
    • generic
    • generic
    • Verified

    Description


      [[Runtime exceptions]] - run the followings commands in this order, notice java.lang.ClassCastException twice:

      jjs> tryItOut = function(c){try{f = Function(c)}catch(e){return} try{rv=f()}catch(e){print(e)}}
      function(c){try{f = Function(c)}catch(e){return} try{rv=f()}catch(e){print(e)}}
      jjs> tryItOut("/*for..in*/for(var window.this in ((/a/gi)({} | [,])))return;");
      jjs> tryItOut("M:switch(window) { default: M:if(x5 || null) {/*for..in*//* nogeckoex bug 349964 */ for each(var x3 in x4) gc() } }");
      jjs> tryItOut("");
      jjs> tryItOut("if((y = this)[(\n[[]])]) {{}; } else if ((eval(\";\", x5).constructor = x)) break ;{} else {x = window, __noSuchMethod__ = false;gc() }");
      jjs> tryItOut("{var x = '' ; }");
      jjs> tryItOut("if(new Boolean(this.__noSuchMethod__ = typeof '' )) {return '' ;[[1]] } else if (((new String(new (undefined)(), /x/ ))[true >= 0/*\n*/])) /*for..in*/L:for(var x in ((({}).hasOwnProperty)(true)));");
      jjs> tryItOut("with({}) { [1,2,3,4].map } ");
      jjs> tryItOut("gc()");
      java.lang.ClassCastException: java.lang.String cannot be cast to jdk.nashorn.internal.runtime.ScriptFunction
      jjs> tryItOut("L:with(x, x5; ^= /x/ ){if(x3-=false) { if ((this.zzz.zzz)) /a/gi} else 1e4; }");
      jjs> tryItOut("if(new (window)( '' , x) < x.x) {1e-81;( /x/g ); } else if (new (new Function)(x3 = {}, ((-1)(this, undefined)))) {[1,,](functional); }");
      java.lang.ClassCastException: java.lang.String cannot be cast to jdk.nashorn.internal.runtime.ScriptFunction

      Attachments

        Activity

          People

            sundar Sundararajan Athijegannathan
            sundar Sundararajan Athijegannathan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: