Explicitly don't support setting the remote address of a RemotePtr outside of the constructor.
This behaviour is in line with sapi::v::Proto.
PiperOrigin-RevId: 696800825
Change-Id: Ied6eaa6f464530b184b2e719e22080921fd226fa
diff --git a/sandboxed_api/var_ptr.h b/sandboxed_api/var_ptr.h
index 2c9894f..774e48e 100644
--- a/sandboxed_api/var_ptr.h
+++ b/sandboxed_api/var_ptr.h
@@ -22,6 +22,7 @@
#include "absl/base/attributes.h"
#include "absl/base/macros.h"
+#include "absl/log/log.h"
#include "absl/strings/str_format.h"
#include "sandboxed_api/var_abstract.h"
#include "sandboxed_api/var_reg.h"
@@ -98,6 +99,10 @@
pointed_obj_.SetRemote(remote_addr);
}
+ void SetRemote(void* /* remote */) override {
+ LOG(FATAL) << "SetRemote not supported on RemotePtr";
+ }
+
private:
Reg<void*> pointed_obj_;
};