Skip to content

Commit 14fa488

Browse files
committed
fix(analysis): reject shielded types with transient storage
Transient storage is a separate storage space that requires special privacy considerations for traces. Reject shielded transient variables at the declaration level with DeclarationError 9826. The previous codegen fix (TSTORE/TLOAD for transient shielded) remains as defense-in-depth but is now unreachable.
1 parent fb22b62 commit 14fa488

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

libsolidity/analysis/DeclarationTypeChecker.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,13 @@ void DeclarationTypeChecker::endVisit(VariableDeclaration const& _variable)
508508
"Initialization of transient storage state variables is not supported."
509509
);
510510

511+
if (_variable.typeName().annotation().type->isShielded())
512+
m_errorReporter.declarationError(
513+
9826_error,
514+
_variable.location(),
515+
"Shielded types cannot be used with transient storage."
516+
);
517+
511518
typeLoc = DataLocation::Transient;
512519
break;
513520
default:

0 commit comments

Comments
 (0)