Skip to content

Commit

Permalink
Fix update_slice visibility issue
Browse files Browse the repository at this point in the history
If operand is public, update is secret. We should not cast update to public.
  • Loading branch information
tpppppub authored Nov 13, 2024
1 parent d7e8238 commit 44273e7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libspu/kernel/hal/shape_ops.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ Value update_slice(SPUContext* ctx, const Value& in, const Value& update,
SPU_TRACE_HAL_DISP(ctx, in, start_indices);

if (in.storage_type() != update.storage_type()) {
auto u =
_cast_type(ctx, update, in.storage_type()).setDtype(update.dtype());

return update_slice(ctx, in, u, start_indices);
auto ct = _common_type(ctx, update.storage_type(), in.storage_type());
auto u = _cast_type(ctx, update, ct).setDtype(update.dtype());
auto i = _cast_type(ctx, in, ct).setDtype(in.dtype());
return update_slice(ctx, i, u, start_indices);
}

return _update_slice(ctx, in, update, start_indices).setDtype(in.dtype());
Expand Down

0 comments on commit 44273e7

Please sign in to comment.