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

Fix bug in understanding regex_search & regex_match parameter writes #1186

Merged
merged 1 commit into from
May 29, 2020

Conversation

lgritz
Copy link
Collaborator

@lgritz lgritz commented May 29, 2020

There was an oslc bug a long time ago (prior to OSL 1.10) in which the
3-argument versions of regex_search and regex_match failed to mark
their 'results' parameter as write-only in the oso.

In addition to fixing the bug in oslc so that subsequently-produced
oso files are correct, in order to properly interpret these
historically-compiled oso's, we also look for this particular case
upon reading the oso, in loadshader.cpp, and mark it correctly. This
was PR #922.

Except...

  1. We neglected to distinguish the 2-arg version from the 3-arg version,
    only the latter of which should be so marked.

  2. We tested for regex_search twice (!) instead of testing for
    regex_search and also regex_match.

Apologies! Here is the fix.

Thanks to Alex Wells for identifying the problem.

Signed-off-by: Larry Gritz lg@larrygritz.com

There was an oslc bug a long time ago (prior to OSL 1.10) in which the
3-argument versions of regex_search and regex_match failed to mark
their 'results' parameter as write-only in the oso.

In addition to fixing the bug in oslc so that subsequently-produced
oso files are correct, in order to properly interpret these
historically-compiled oso's, we also look for this particular case
upon reading the oso, in loadshader.cpp, and mark it correctly. This
was PR AcademySoftwareFoundation#922.

Except...

1) We neglected to distinguish the 2-arg version from the 3-arg version,
only the latter of which should be so marked.

2) We tested for regex_search twice (!) instead of testing for
regex_search and also regex_match.

Apologies! Here is the fix.

Thanks to Alex Wells for identifying the problem.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
Copy link
Contributor

@AlexMWells AlexMWells left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch on not checking regex_match.

LGTM

@lgritz lgritz merged commit 2f2a40d into AcademySoftwareFoundation:master May 29, 2020
@lgritz lgritz deleted the lg-regex branch June 2, 2020 16:44
lgritz added a commit to lgritz/OpenShadingLanguage that referenced this pull request Jun 2, 2020
…cademySoftwareFoundation#1186)

There was an oslc bug a long time ago (prior to OSL 1.10) in which the
3-argument versions of regex_search and regex_match failed to mark
their 'results' parameter as write-only in the oso.

In addition to fixing the bug in oslc so that subsequently-produced
oso files are correct, in order to properly interpret these
historically-compiled oso's, we also look for this particular case
upon reading the oso, in loadshader.cpp, and mark it correctly. This
was PR AcademySoftwareFoundation#922.

Except...

1) We neglected to distinguish the 2-arg version from the 3-arg version,
only the latter of which should be so marked.

2) We tested for regex_search twice (!) instead of testing for
regex_search and also regex_match.

Apologies! Here is the fix.

Thanks to Alex Wells for identifying the problem.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants