Skip to content

Commit 669bdfe

Browse files
committed
fixed safe but illegal out-of-bounds std::vector accesses that cause VS builds to break in debug when using OSL.
1 parent 23f92b8 commit 669bdfe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/osl/src/liboslexec/oslexec_pvt.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -521,14 +521,14 @@ class ShaderInstance {
521521
return std::pair<Symbol*,Symbol*> ((Symbol*)NULL, (Symbol*)NULL);
522522
else
523523
return std::pair<Symbol*,Symbol*> (&i->m_instsymbols[0],
524-
&i->m_instsymbols[i->m_instsymbols.size()]);
524+
&i->m_instsymbols[0] + i->m_instsymbols.size());
525525
}
526526
friend std::pair<const Symbol *,const Symbol *> sym_range (const ShaderInstance *i) {
527527
if (i->m_instsymbols.size() == 0)
528528
return std::pair<const Symbol*,const Symbol*> ((const Symbol*)NULL, (const Symbol*)NULL);
529529
else
530530
return std::pair<const Symbol*,const Symbol*> (&i->m_instsymbols[0],
531-
&i->m_instsymbols[i->m_instsymbols.size()]);
531+
&i->m_instsymbols[0] + i->m_instsymbols.size());
532532
}
533533

534534
int Psym () const { return m_Psym; }

0 commit comments

Comments
 (0)