RFR: 8247732: validate user-input intrinsic_ids in ControlIntrinsic [v7]

Xin Liu xliu at openjdk.java.net
Thu Nov 26 01:55:57 UTC 2020


On Thu, 19 Nov 2020 00:19:35 GMT, Xin Liu <xliu at openjdk.org> wrote:

>> In general - I like it a lot. I will take it for a spin and go through the PR.
>> 
>> A heads up is that this PR will clash a bit with https://github.com/openjdk/jdk/pull/1276 which adds validation of the compile commands. Your change to compilerOracle.*pp seems well contained so there should be no problem to merge them.
>
> Hi, Nils, 
> 
> Thank you for reviewing the lengthy PR!
> The major part is to extend the testing framework to include ControlIntrinsic.  It may be also useful to test other compiler directives whose arguments are ccstr/ccstrlist.  
> 
> I am watching JDK-8256508.  I will update this PR accordingly if it needs. 
> 
> thanks, 
> --lx

to adapt JDK-8256508,  I change compilerOracle.cpp as follows. 
I also merge 2 if constructs into one. 

      if (option == CompileCommand::ControlIntrinsic || option == CompileCommand::DisableIntrinsic) {
        ControlIntrinsicValidator validator(value, (option == CompileCommand::DisableIntrinsic));

        if (!validator.is_valid()) {
          jio_snprintf(errorbuf, buf_size, "Unrecognized intrinsic detected in %s: %s", option2name(option), validator.what());
        }
      }

-------------

PR: https://git.openjdk.java.net/jdk/pull/1179


More information about the hotspot-compiler-dev mailing list